Spring Boot Test

Spring Boot Test extends and simplifies the Spring-test module provided by the Spring Framework. Let's look at the essential elements to write our acceptance tests and then we can revisit the details later in the chapter:

  1. Copy the project that we created in Chapter 4Extending Your Cloud-Native Application with HSQLDB and Hazelcast, as a new project for this chapter.
  1. Include the dependency on Spring in the Maven POM file:
        <dependency> 
            <groupId>org.springframework.boot</groupId> 
            <artifactId>spring-boot-starter-test</artifactId> 
            <scope>test</scope> 
        </dependency> 

As you may have noticed, the scope is changed to test. This means that the dependency we are defining is not required for normal runtime, only for compilation ...

Get Cloud-Native Applications in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.