class MethodArgumentsProvider extends AnnotationBasedArgumentsProvider<MethodSource>
| Modifier and Type | Field and Description |
|---|---|
private static java.util.function.Predicate<java.lang.reflect.Method> |
isFactoryMethod |
| Constructor and Description |
|---|
MethodArgumentsProvider() |
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.reflect.Method |
findFactoryMethod(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod,
java.lang.String factoryMethodName) |
(package private) static java.lang.reflect.Method |
findFactoryMethodByFullyQualifiedName(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod,
java.lang.String fullyQualifiedMethodName) |
private static java.lang.reflect.Method |
findFactoryMethodBySimpleName(java.lang.Class<?> clazz,
java.lang.reflect.Method testMethod,
java.lang.String factoryMethodName)
Find the factory method by searching for all methods in the given
clazz
with the desired factoryMethodName which have return types that can be
converted to a Stream, ignoring the testMethod itself as well
as any @Test, @TestTemplate, or @TestFactory methods
with the same name. |
private static boolean |
isTestMethod(java.lang.reflect.Method candidate) |
private static java.lang.Class<?> |
loadRequiredClass(java.lang.String className,
java.lang.ClassLoader classLoader) |
private static boolean |
looksLikeAFullyQualifiedMethodName(java.lang.String factoryMethodName) |
protected java.util.stream.Stream<? extends Arguments> |
provideArguments(ExtensionContext context,
MethodSource methodSource)
Provide a
Stream of Arguments — based on metadata in the
provided annotation — to be passed to a @ParameterizedTest method. |
private static Arguments |
toArguments(java.lang.Object item) |
private static java.lang.reflect.Method |
validateFactoryMethod(java.lang.reflect.Method factoryMethod,
java.lang.Object testInstance) |
accept, provideArgumentsprivate static final java.util.function.Predicate<java.lang.reflect.Method> isFactoryMethod
protected java.util.stream.Stream<? extends Arguments> provideArguments(ExtensionContext context, MethodSource methodSource)
AnnotationBasedArgumentsProviderStream of Arguments — based on metadata in the
provided annotation — to be passed to a @ParameterizedTest method.provideArguments in class AnnotationBasedArgumentsProvider<MethodSource>context - the current extension context; never nullmethodSource - the annotation to process; never nullnullprivate static java.lang.reflect.Method findFactoryMethod(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod,
java.lang.String factoryMethodName)
private static boolean looksLikeAFullyQualifiedMethodName(java.lang.String factoryMethodName)
static java.lang.reflect.Method findFactoryMethodByFullyQualifiedName(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod,
java.lang.String fullyQualifiedMethodName)
private static java.lang.reflect.Method findFactoryMethodBySimpleName(java.lang.Class<?> clazz,
java.lang.reflect.Method testMethod,
java.lang.String factoryMethodName)
clazz
with the desired factoryMethodName which have return types that can be
converted to a Stream, ignoring the testMethod itself as well
as any @Test, @TestTemplate, or @TestFactory methods
with the same name.PreconditionViolationException - if the factory method was not found or
multiple competing factory methods with the same name were foundprivate static boolean isTestMethod(java.lang.reflect.Method candidate)
private static java.lang.Class<?> loadRequiredClass(java.lang.String className,
java.lang.ClassLoader classLoader)
private static java.lang.reflect.Method validateFactoryMethod(java.lang.reflect.Method factoryMethod,
java.lang.Object testInstance)
private static Arguments toArguments(java.lang.Object item)