Class MethodArgumentsProvider

    • Field Detail

      • isFactoryMethod

        private static final java.util.function.Predicate<java.lang.reflect.Method> isFactoryMethod
    • Constructor Detail

      • MethodArgumentsProvider

        MethodArgumentsProvider()
    • Method Detail

      • findFactoryMethod

        private static java.lang.reflect.Method findFactoryMethod​(java.lang.Class<?> testClass,
                                                                  java.util.Optional<java.lang.reflect.Method> testMethod,
                                                                  java.lang.String factoryMethodName)
      • looksLikeAFullyQualifiedMethodName

        private static boolean looksLikeAFullyQualifiedMethodName​(java.lang.String factoryMethodName)
      • findFactoryMethodByFullyQualifiedName

        static java.lang.reflect.Method findFactoryMethodByFullyQualifiedName​(java.lang.Class<?> testClass,
                                                                              java.util.Optional<java.lang.reflect.Method> testMethod,
                                                                              java.lang.String fullyQualifiedMethodName)
      • findFactoryMethodBySimpleName

        private static java.lang.reflect.Method findFactoryMethodBySimpleName​(java.lang.Class<?> clazz,
                                                                              java.util.Optional<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.
        Returns:
        the single factory method matching the search criteria
        Throws:
        org.junit.platform.commons.PreconditionViolationException - if the factory method was not found or multiple competing factory methods with the same name were found
      • isTestMethod

        private static boolean isTestMethod​(java.lang.reflect.Method candidate)
      • validateFactoryMethod

        private static java.lang.reflect.Method validateFactoryMethod​(java.lang.reflect.Method factoryMethod,
                                                                      java.lang.Object testInstance)