Class LifecycleMethodUtils


  • final class LifecycleMethodUtils
    extends java.lang.Object
    Collection of utilities for working with test lifecycle methods.
    Since:
    5.0
    • Constructor Detail

      • LifecycleMethodUtils

        private LifecycleMethodUtils()
    • Method Detail

      • findBeforeAllMethods

        static java.util.List<java.lang.reflect.Method> findBeforeAllMethods​(java.lang.Class<?> testClass,
                                                                             boolean requireStatic,
                                                                             DiscoveryIssueReporter issueReporter)
      • findAfterAllMethods

        static java.util.List<java.lang.reflect.Method> findAfterAllMethods​(java.lang.Class<?> testClass,
                                                                            boolean requireStatic,
                                                                            DiscoveryIssueReporter issueReporter)
      • findBeforeEachMethods

        static java.util.List<java.lang.reflect.Method> findBeforeEachMethods​(java.lang.Class<?> testClass,
                                                                              DiscoveryIssueReporter issueReporter)
      • findAfterEachMethods

        static java.util.List<java.lang.reflect.Method> findAfterEachMethods​(java.lang.Class<?> testClass,
                                                                             DiscoveryIssueReporter issueReporter)
      • validateNoClassTemplateInvocationLifecycleMethodsAreDeclared

        static void validateNoClassTemplateInvocationLifecycleMethodsAreDeclared​(java.lang.Class<?> testClass,
                                                                                 DiscoveryIssueReporter issueReporter)
      • validateClassTemplateInvocationLifecycleMethodsAreDeclaredCorrectly

        static void validateClassTemplateInvocationLifecycleMethodsAreDeclaredCorrectly​(java.lang.Class<?> testClass,
                                                                                        boolean requireStatic,
                                                                                        DiscoveryIssueReporter issueReporter)
      • findAllClassTemplateInvocationLifecycleMethods

        private static java.util.stream.Stream<java.lang.reflect.Method> findAllClassTemplateInvocationLifecycleMethods​(java.lang.Class<?> testClass)
      • findMethodsAndCheckStatic

        private static java.util.List<java.lang.reflect.Method> findMethodsAndCheckStatic​(java.lang.Class<?> testClass,
                                                                                          boolean requireStatic,
                                                                                          java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                                                                          org.junit.platform.commons.support.HierarchyTraversalMode traversalMode,
                                                                                          DiscoveryIssueReporter issueReporter)
      • findMethodsAndCheckNonStatic

        private static java.util.List<java.lang.reflect.Method> findMethodsAndCheckNonStatic​(java.lang.Class<?> testClass,
                                                                                             java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                                                                             org.junit.platform.commons.support.HierarchyTraversalMode traversalMode,
                                                                                             DiscoveryIssueReporter issueReporter)
      • findMethodsAndCheckVoidReturnType

        private static java.util.List<java.lang.reflect.Method> findMethodsAndCheckVoidReturnType​(java.lang.Class<?> testClass,
                                                                                                  java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                                                                                  org.junit.platform.commons.support.HierarchyTraversalMode traversalMode,
                                                                                                  DiscoveryIssueReporter issueReporter,
                                                                                                  DiscoveryIssueReporter.Condition<? super java.lang.reflect.Method> additionalCondition)
      • classTemplateInvocationLifecycleMethodAnnotationName

        private static java.lang.String classTemplateInvocationLifecycleMethodAnnotationName​(java.lang.reflect.Method method)
      • findClassTemplateInvocationLifecycleMethodAnnotation

        private static java.util.Optional<org.junit.jupiter.api.extension.ClassTemplateInvocationLifecycleMethod> findClassTemplateInvocationLifecycleMethodAnnotation​(java.lang.reflect.Method method)