Package org.springframework.test.context
Interface ContextCustomizerFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ContextCustomizerFactory
Factory for creatingContextCustomizers
.Factories are invoked after
ContextLoaders
have processed context configuration attributes but before theMergedContextConfiguration
is created.By default, the Spring TestContext Framework will use the
SpringFactoriesLoader
mechanism for loading factories configured in allMETA-INF/spring.factories
files on the classpath.- Since:
- 4.3
- Author:
- Phillip Webb, Sam Brannen
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ContextCustomizer
createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes)
Create aContextCustomizer
that should be used to customize aConfigurableApplicationContext
before it is refreshed.
Method Detail
createContextCustomizer
@Nullable ContextCustomizer createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes)
Create aContextCustomizer
that should be used to customize aConfigurableApplicationContext
before it is refreshed.- Parameters:
testClass
- the test classconfigAttributes
- the list of context configuration attributes for the test class, ordered bottom-up (i.e., as if we were traversing up the class hierarchy); nevernull
or empty- Returns:
- a
ContextCustomizer
ornull
if no customizer should be used