类 TestConstructorUtils
java.lang.Object
cn.taketoday.test.context.support.TestConstructorUtils
Utility methods for working with
@TestConstructor.
Primarily intended for use within the framework.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private static final Set<Class<? extends Annotation>>private static final cn.taketoday.logging.Logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static booleanisAnnotatedWithAutowiredOrInject(Constructor<?> constructor) static booleanisAutowirableConstructor(Constructor<?> constructor, Class<?> testClass) Determine if the supplied constructor for the given test class is autowirable.static booleanisAutowirableConstructor(Constructor<?> constructor, Class<?> testClass, PropertyProvider fallbackPropertyProvider) Determine if the supplied constructor for the given test class is autowirable.static booleanisAutowirableConstructor(Executable executable, Class<?> testClass) Determine if the supplied executable for the given test class is an autowirable constructor.static booleanisAutowirableConstructor(Executable executable, Class<?> testClass, PropertyProvider fallbackPropertyProvider) Determine if the supplied executable for the given test class is an autowirable constructor.
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger -
autowiredAnnotationTypes
-
-
构造器详细资料
-
TestConstructorUtils
private TestConstructorUtils()
-
-
方法详细资料
-
isAutowirableConstructor
Determine if the supplied executable for the given test class is an autowirable constructor.This method delegates to
isAutowirableConstructor(Executable, Class, PropertyProvider)will a value ofnullfor the fallbackPropertyProvider.- 参数:
executable- an executable for the test classtestClass- the test class- 返回:
trueif the executable is an autowirable constructor- 另请参阅:
-
isAutowirableConstructor
Determine if the supplied constructor for the given test class is autowirable.This method delegates to
isAutowirableConstructor(Constructor, Class, PropertyProvider)will a value ofnullfor the fallbackPropertyProvider.- 参数:
constructor- a constructor for the test classtestClass- the test class- 返回:
trueif the constructor is autowirable- 另请参阅:
-
isAutowirableConstructor
public static boolean isAutowirableConstructor(Executable executable, Class<?> testClass, @Nullable PropertyProvider fallbackPropertyProvider) Determine if the supplied executable for the given test class is an autowirable constructor.This method delegates to
isAutowirableConstructor(Constructor, Class, PropertyProvider)if the supplied executable is a constructor and otherwise returnsfalse.- 参数:
executable- an executable for the test classtestClass- the test classfallbackPropertyProvider- fallback property provider used to look up the value forTestConstructor.TEST_CONSTRUCTOR_AUTOWIRE_MODE_PROPERTY_NAMEif no such value is found inTodayStrategies- 返回:
trueif the executable is an autowirable constructor- 另请参阅:
-
isAutowirableConstructor
public static boolean isAutowirableConstructor(Constructor<?> constructor, Class<?> testClass, @Nullable PropertyProvider fallbackPropertyProvider) Determine if the supplied constructor for the given test class is autowirable.A constructor is considered to be autowirable if one of the following conditions is
true.- The constructor is annotated with
@Autowired,@jakarta.inject.Inject, or@javax.inject.Inject. @TestConstructoris present or meta-present on the test class withautowireModeset toALL.- The default test constructor autowire mode has been set to
ALLinTodayStrategiesor in the supplied fallbackPropertyProvider(seeTestConstructor.TEST_CONSTRUCTOR_AUTOWIRE_MODE_PROPERTY_NAME).
- 参数:
constructor- a constructor for the test classtestClass- the test classfallbackPropertyProvider- fallback property provider used to look up the value for the default test constructor autowire mode if no such value is found inTodayStrategies- 返回:
trueif the constructor is autowirable
- The constructor is annotated with
-
isAnnotatedWithAutowiredOrInject
-