Intermediate Package
The intermediate package helps you to write both integration and end-to-end tests for Spring and Spring Boot web applications. This package consists of nine topics:
The Introduction to Integration Testing topic describes how you can keep your code base clean by separating unit and integration tests. After you have completed this topic, you can create different source and resource directories for your unit and integration tests, and you understand how you can run your tests with Maven and Gradle.
The Introduction to DbUnit topic helps you to create DbUnit data sets which save both your time and nerves. This topic describes how you can insert the required test data into your database and write assertions for the data found from the database. Also, you will learn two techniques that help you to create DbUnit unit data sets which are easy to read, write, and maintain. Finally, you will learn how constant classes can make your life easier when you want to use your test data in your integration tests.
The Configuring Our Integration Tests topic helps you to configure the application context of your integration tests when you are writing integration tests for Spring and Spring Boot web applications. Also, you will learn to use configuration which allows you to write tests which don’t depend on external factors or services that cannot be controlled by the system under test (such as time).
After you have completed this topic, you can configure the application context configuration class that’s used by your integration tests, you understand how you can integrate DbUnit with the Spring Test framework and customize its configuration,
and you know how you can configure the Spring MVC Test framework and integrate Spring Security with it.
The Writing Integration Tests for Spring Web Applications topic helps you to write tests which ensure that your web application is working as expected. Also, you will learn how you can ensure that only authorized users can access the data that’s processed by your web application.
This topic describes how you can use DbUnit data sets in your integration tests, helps you to write assertions for autogenerated values, and explains how you can you to write integration tests for Spring powered repositories and Spring MVC controllers.
In other words, after you have completed this topic, you can write integration tests for normal Spring MVC web applications and REST APIs.
The Introduction to End-to-End Testing topic describes how you can keep your code base clean by separating unit, integration, and end-to-end tests. In other words, this lesson explains how you can create different source and resource directories for your unit, integration, and end-to-end tests. Also, you will learn to run your tests with Maven and Gradle. Finally, this topic provides a quick introduction to Selenium WebDriver that helps you to understand the other lessons of the end-to-end testing module.
The Configuring Our End-to-End Tests topic describes how you can configure your end-to-end tests without writing any duplicate code when you are writing end-to-end tests for a Spring or a Spring Boot web application. Also, you will learn to initialize your database into a known state by using both Liquibase and the @Sql
annotation.
To summarize, the techniques described by this topic help you to save time when you configure your end-to-end tests and ensure that you can write assertions for the data shown to the user of your web application.
The The Writing End-to-End Tests for Spring Web Applications topic helps you to save time when you are writing end-to-end tests for normal web applications. This topic starts by explaining how you can find elements from HTML documents and control the used web browser with Selenium WebDriver. After you are familiar with the basics, you will learn to create page objects which contain all page specific logic. The page object pattern helps you remove duplicate code from your test suite and write tests which are easy to read, write, and maintain. Finally, this topic describes how you can write end-to-end tests for normal Spring and Spring Boot web applications.
The Writing End-to-End Tests for Javascript Web Applications topic describes techniques which help you to write deterministic (non-flaky) tests for Javascript web applications by using Selenium WebDriver. After you have completed this topic, you understand how you can save your time by minimizing the number of false positives.
The Bonus Webinars topic contains the bonus webinars that were recording during 2017. These webinars help you to mock and stub external REST APIs, and describe how you can get started with Junit 5.
The intermediate package contains the starter package.
Package Content
Writing Integration Tests for Spring Web Applications
-
Using DbUnit Data Sets in Our Integration Tests
-
Resetting Generated Id Column Values Before Every Test Method
-
Writing Integration Tests for Spring Powered Repositories
-
Writing Integration Tests for “Normal” Controllers – Rendering Data
-
Writing Integration Tests for “Normal” Controllers – Forms
-
Writing Integration Tests for a REST API – Reading Data
-
Writing Integration Tests for a REST API – Writing Data
-
Writing Security Tests for Spring MVC Controllers
- Using DbUnit Data Sets in Our Integration Tests
- Resetting Generated Id Column Values Before Every Test Method
- Writing Integration Tests for Spring Powered Repositories
- Writing Integration Tests for “Normal” Controllers – Rendering Data
- Writing Integration Tests for “Normal” Controllers – Forms
- Writing Integration Tests for a REST API – Reading Data
- Writing Integration Tests for a REST API – Writing Data
- Writing Security Tests for Spring MVC Controllers
Writing End-to-End Tests for Spring Web Applications
-
Finding Elements From HTML Documents
-
Controlling a Web Browser With Selenium WebDriver
-
Introduction to Page Objects
-
Creating Our First Page Object
-
Writing End-to-End Tests for Spring Web Applications – Rendering a Single Item
-
Writing End-to-End Tests for Spring Web Applications – Rendering a List
-
Writing End-to-End Tests for Spring Web Applications – Submitting a Form
- Finding Elements From HTML Documents
- Controlling a Web Browser With Selenium WebDriver
- Introduction to Page Objects
- Creating Our First Page Object
- Writing End-to-End Tests for Spring Web Applications – Rendering a Single Item
- Writing End-to-End Tests for Spring Web Applications – Rendering a List
- Writing End-to-End Tests for Spring Web Applications – Submitting a Form