January 2018
Intermediate to advanced
414 pages
10h 29m
English
When we create a Spring Boot application using Spring Initializr; it will already contain a test that uses SpringBootTest. In our example, we can just open the Chapter09ApplicationTests file, which is under the src/test/kotlin/com/microservices/chapter09 path:
package com.microservices.chapter09import org.junit.Testimport org.junit.runner.RunWithimport org.springframework.boot.test.context.SpringBootTestimport org.springframework.test.context.junit4.SpringRunner@RunWith(SpringRunner::class)@SpringBootTestclass Chapter09ApplicationTests { @Test fun contextLoads() { }}
This is a JUnit test that uses SpringBootTest to test that the Spring application can run. Let's understand it in detail. First, we indicate to JUnit, ...
Read now
Unlock full access