public class SpringApplicationContextLoader
extends AbstractContextLoader
ContextLoader
that can be used to test Spring Boot applications (those that
normally startup using SpringApplication
). Never starts an embedded web server,
but detects the @WebAppConfiguration
annotation on the test
class and only creates a web application context if it is present. Non-web features,
like a repository layer, can be tested cleanly by simply not marking the test
class @WebAppConfiguration
.
If @ActiveProfiles
are provided in the test class they will be used to
create the application context.
Constructor and Description |
---|
SpringApplicationContextLoader() |
Modifier and Type | Method and Description |
---|---|
protected String |
getResourceSuffix() |
org.springframework.context.ApplicationContext |
loadContext(MergedContextConfiguration mergedConfig) |
org.springframework.context.ApplicationContext |
loadContext(String... locations) |
public org.springframework.context.ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception
Exception
public org.springframework.context.ApplicationContext loadContext(String... locations) throws Exception
Exception
protected String getResourceSuffix()
Copyright © 2014. All rights reserved.