Class SpringBootContextLoader

All Implemented Interfaces:
AotContextLoader, ContextLoader, SmartContextLoader

public class SpringBootContextLoader extends AbstractContextLoader implements AotContextLoader
A ContextLoader that can be used to test Spring Boot applications (those that normally startup using SpringApplication). Although this loader can be used directly, most test will instead want to use it with @SpringBootTest.

The loader supports both standard MergedContextConfiguration as well as WebMergedContextConfiguration. If WebMergedContextConfiguration is used the context will either use a mock servlet environment, or start the full embedded web server.

If @ActiveProfiles are provided in the test class they will be used to create the application context.

Dave Syer, Phillip Webb, Andy Wilkinson, Stephane Nicoll, Madhura Bhave, Scott Frederick
See Also: