April 2018
Intermediate to advanced
432 pages
10h 38m
English
As you might have read in the previous section, there are some different strategies and approaches to the tests in your application. I have briefly mentioned all of them, so now we may proceed to the practical aspects. Spring Boot provides a set of utilities that help in the implementation of automated tests. In order to enable these features in the project, you have to include the spring-boot-starter-test starter to the dependencies. It imports not only the spring-test and spring-boot-test artifacts, but also some other useful test libraries, such as JUnit, Mockito, and AssertJ:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope>