接口 ContextCustomizer
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ContextCustomizer
Strategy interface for customizingapplication contextsthat are created and managed by the Spring TestContext Framework.Customizers are created by
ContextCustomizerFactoryimplementations.Implementations must implement correct
equalsandhashCodemethods since customizers form part of theMergedContextConfigurationwhich is used as a cache key.- 从以下版本开始:
- 4.3
- 作者:
- Phillip Webb, Sam Brannen
- 另请参阅:
ContextCustomizerFactory,AbstractContextLoader.customizeContext(org.springframework.context.ConfigurableApplicationContext, org.springframework.test.context.MergedContextConfiguration)
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidcustomizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig)Customize the suppliedConfigurableApplicationContextafter bean definitions have been loaded into the context but before the context has been refreshed.
方法详细资料
customizeContext
void customizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig)
Customize the suppliedConfigurableApplicationContextafter bean definitions have been loaded into the context but before the context has been refreshed.- 参数:
context- the context to customizemergedConfig- the merged context configuration