Class WebTestContextBootstrapper
java.lang.Object
org.springframework.test.context.support.AbstractTestContextBootstrapper
org.springframework.test.context.support.DefaultTestContextBootstrapper
org.springframework.test.context.web.WebTestContextBootstrapper
- All Implemented Interfaces:
- TestContextBootstrapper
Web-specific implementation of the 
TestContextBootstrapper SPI.
 - Uses WebDelegatingSmartContextLoaderas the defaultContextLoaderif the test class is annotated with@WebAppConfigurationand otherwise delegates to the superclass.
- Builds a WebMergedContextConfigurationif the test class is annotated with@WebAppConfiguration.
- Since:
- 4.1
- Author:
- Sam Brannen
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected Class<? extends ContextLoader> getDefaultContextLoaderClass(Class<?> testClass) ReturnsWebDelegatingSmartContextLoaderif the supplied class is annotated with@WebAppConfigurationand otherwise delegates to the superclass.protected MergedContextConfigurationprocessMergedContextConfiguration(MergedContextConfiguration mergedConfig) Returns aWebMergedContextConfigurationif the test class in the suppliedMergedContextConfigurationis annotated with@WebAppConfigurationand otherwise returns the supplied instance unmodified.Methods inherited from class org.springframework.test.context.support.AbstractTestContextBootstrapperbuildMergedContextConfiguration, buildTestContext, getBootstrapContext, getCacheAwareContextLoaderDelegate, getContextCustomizerFactories, getDefaultTestExecutionListeners, getTestExecutionListeners, resolveContextLoader, resolveExplicitContextLoaderClass, setBootstrapContext
- 
Constructor Details- 
WebTestContextBootstrapperpublic WebTestContextBootstrapper()
 
- 
- 
Method Details- 
getDefaultContextLoaderClassReturnsWebDelegatingSmartContextLoaderif the supplied class is annotated with@WebAppConfigurationand otherwise delegates to the superclass.- Overrides:
- getDefaultContextLoaderClassin class- DefaultTestContextBootstrapper
- Parameters:
- testClass- the test class for which to retrieve the default- ContextLoaderclass
- Returns:
- the default ContextLoaderclass for the supplied test class (nevernull)
 
- 
processMergedContextConfigurationprotected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) Returns aWebMergedContextConfigurationif the test class in the suppliedMergedContextConfigurationis annotated with@WebAppConfigurationand otherwise returns the supplied instance unmodified.- Overrides:
- processMergedContextConfigurationin class- AbstractTestContextBootstrapper
- Parameters:
- mergedConfig- the- MergedContextConfigurationto process; never- null
- Returns:
- a fully initialized MergedContextConfiguration; nevernull
 
 
-