类 AnnotationConfigContextLoaderUtils
- java.lang.Object
- org.springframework.test.context.support.AnnotationConfigContextLoaderUtils
public abstract class AnnotationConfigContextLoaderUtils extends Object
Utility methods forSmartContextLoadersthat deal with component classes (e.g.,@Configurationclasses).- 从以下版本开始:
- 3.2
- 作者:
- Sam Brannen
构造器概要
构造器 构造器 说明 AnnotationConfigContextLoaderUtils()
构造器详细资料
AnnotationConfigContextLoaderUtils
public AnnotationConfigContextLoaderUtils()
方法详细资料
detectDefaultConfigurationClasses
public static Class<?>[] detectDefaultConfigurationClasses(Class<?> declaringClass)
Detect the default configuration classes for the supplied test class.The returned class array will contain all static nested classes of the supplied class that meet the requirements for
@Configurationclass implementations as specified in the documentation for@Configuration.The implementation of this method adheres to the contract defined in the
SmartContextLoaderSPI. Specifically, this method uses introspection to detect default configuration classes that comply with the constraints required of@Configurationclass implementations. If a potential candidate configuration class does not meet these requirements, this method will log a debug message, and the potential candidate class will be ignored.- 参数:
declaringClass- the test class that declared@ContextConfiguration- 返回:
- an array of default configuration classes, potentially empty but never
null