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 Summary
Constructors -
Method Summary
Modifier 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 AbstractTestContextBootstrapper
buildMergedContextConfiguration, buildTestContext, getBootstrapContext, getCacheAwareContextLoaderDelegate, getContextCustomizerFactories, getDefaultTestExecutionListeners, getTestExecutionListeners, resolveContextLoader, resolveExplicitContextLoaderClass, setBootstrapContext
-
Constructor Details
-
webTestContextBootstrapper
public webTestContextBootstrapper()
-
-
Method Details
-
getDefaultContextLoaderClass
ReturnswebDelegatingSmartContextLoaderif the supplied class is annotated with@webAppConfigurationand otherwise delegates to the superclass.- Overrides:
getDefaultContextLoaderClassin classDefaultTestContextBootstrapper- Parameters:
testClass- the test class for which to retrieve the defaultContextLoaderclass- Returns:
- the default
ContextLoaderclass for the supplied test class (nevernull)
-
processMergedContextConfiguration
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) Returns awebMergedContextConfigurationif the test class in the suppliedMergedContextConfigurationis annotated with@webAppConfigurationand otherwise returns the supplied instance unmodified.- Overrides:
processMergedContextConfigurationin classAbstractTestContextBootstrapper- Parameters:
mergedConfig- theMergedContextConfigurationto process; nevernull- Returns:
- a fully initialized
MergedContextConfiguration; nevernull
-