liveBook · Manning

@SpringBootTest

@SpringBootTest is a Spring Boot testing annotation that loads an application context with Spring Boot support for integration testing.

How 2 Manning books explain it

Spring in Action, Sixth Edition

@SpringBootTest is a Spring Boot testing annotation that loads an application context with Spring Boot test support.

How it is used
Checks that a Spring application context can load successfully during automated JUnit testing.
How deep it goes
Explains context loading and composite annotation behavior, but defers the annotation's additional capabilities.
Examples
Uses TacoCloudApplicationTests with an empty contextLoads test and the ./mvnw test command.
What you can do after
Diagnose configuration changes that prevent the Spring application context from being created.

Read how Spring in Action, Sixth Edition explains @SpringBootTest →

Spring Security in Action, Second Edition

@SpringBootTest is a Spring Boot test annotation that loads an application context for integration testing.

How it is used
Manages the Spring context for integration-style security tests that exercise endpoint behavior.
How deep it goes
Defines context management and endpoint-test integration, but does not detail Spring context internals.
Examples
Uses MainTests, MockMvc calls to /hello, and 401 or 200 status assertions.
What you can do after
Evaluate endpoint authorization by running MockMvc requests inside a managed Spring context.

Read how Spring Security in Action, Second Edition explains @SpringBootTest →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.