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
-