@SpringBootTest tells JUnit to bootstrap a test with Spring Boot capabilities and load the Spring application context. It is the test-class counterpart of calling SpringApplication.run() in a main method. Even an empty test method checks whether the application context can be created successfully. section 1.2.2
A baseline application test
package tacos; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest public class TacoCloudApplicationTests { @Test public void contextLoads() { } } The empty contextLoads method still prompts the annotations to load the application context; configuration problems cause the test to fail. Run it with ./mvnw test. section 1.2.2
Listing 1.3 A baseline application test
package tacos;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest #1
public class TacoCloudApplicationTests {
@Test #2
public void contextLoads() {
}
}
View the complete baseline application-test listing. section 1.2.2

