Class MethodArgumentsProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.function.Predicate<java.lang.reflect.Method> isFactoryMethod  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • 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.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.lang.reflect.Method testMethod,
                                                                              java.lang.String fullyQualifiedMethodName)
      • findFactoryMethodBySimpleName

        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.
        Returns:
        the single factory method matching the search criteria
        Throws:
        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)
      • loadRequiredClass

        private static java.lang.Class<?> loadRequiredClass​(java.lang.String className,
                                                            java.lang.ClassLoader classLoader)
      • validateFactoryMethod

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

        private static Arguments toArguments​(java.lang.Object item)