接口 ContextCustomizerFactory
- 所有已知实现类:
DuplicateJsonObjectContextCustomizerFactory,DynamicPropertiesContextCustomizerFactory,ExcludeFilterContextCustomizerFactory,ImportsContextCustomizerFactory,MockitoContextCustomizerFactory,MockServerContainerContextCustomizerFactory,TestRestTemplateContextCustomizerFactory,WebTestClientContextCustomizerFactory
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Factory for creating
ContextCustomizers.
Factories are invoked after ContextLoaders have
processed context configuration attributes but before the
MergedContextConfiguration is created.
By default, the TestContext Framework will use the
TodayStrategies
mechanism for loading factories configured in all META-INF/today.strategies
files on the classpath.
it is also possible to register factories
declaratively via the @ContextCustomizerFactories
annotation.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Sam Brannen, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes) Create aContextCustomizerthat should be used to customize aConfigurableApplicationContextbefore it is refreshed.
-
方法详细资料
-
createContextCustomizer
@Nullable ContextCustomizer createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes) Create aContextCustomizerthat should be used to customize aConfigurableApplicationContextbefore it is refreshed.- 参数:
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); nevernullor empty- 返回:
- a
ContextCustomizerornullif no customizer should be used
-