Class SpringBootContextLoader

java.lang.Object
org.springframework.test.context.support.AbstractContextLoader
org.springframework.boot.test.context.SpringBootContextLoader
All Implemented Interfaces:
ContextLoader, SmartContextLoader

public class SpringBootContextLoader extends AbstractContextLoader
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.

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