public abstract class TestConstructorUtils extends Object
@TestConstructor.
Primarily intended for use within the framework.
TestConstructor| Modifier and Type | Method and Description |
|---|---|
static boolean |
isAutowirableConstructor(Constructor<?> constructor,
Class<?> testClass)
Determine if the supplied constructor for the given test class is
autowirable.
|
static boolean |
isAutowirableConstructor(Executable executable,
Class<?> testClass)
Determine if the supplied executable for the given test class is an
autowirable constructor.
|
public static boolean isAutowirableConstructor(Executable executable, Class<?> testClass)
This method delegates to isAutowirableConstructor(Constructor, Class)
if the executable is a constructor.
executable - an executable for the test classtestClass - the test classtrue if the executable is an autowirable constructorisAutowirableConstructor(Constructor, Class)public static boolean isAutowirableConstructor(Constructor<?> constructor, Class<?> testClass)
A constructor is considered to be autowirable if one of the following
conditions is true.
@Autowired.@TestConstructor is present or
meta-present on the test class with
autowire set to true.true
(see TestConstructor.TEST_CONSTRUCTOR_AUTOWIRE_PROPERTY_NAME).constructor - a constructor for the test classtestClass - the test classtrue if the constructor is autowirableisAutowirableConstructor(Executable, Class)