Class LifecycleMethodUtils

java.lang.Object
org.junit.jupiter.engine.descriptor.LifecycleMethodUtils

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

    • LifecycleMethodUtils

      private LifecycleMethodUtils()
  • Method Details

    • findBeforeAllMethods

      static List<Method> findBeforeAllMethods(Class<?> testClass, boolean requireStatic, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findAfterAllMethods

      static List<Method> findAfterAllMethods(Class<?> testClass, boolean requireStatic, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findBeforeEachMethods

      static List<Method> findBeforeEachMethods(Class<?> testClass, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findAfterEachMethods

      static List<Method> findAfterEachMethods(Class<?> testClass, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • validateNoClassTemplateInvocationLifecycleMethodsAreDeclared

      static void validateNoClassTemplateInvocationLifecycleMethodsAreDeclared(Class<?> testClass, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • validateClassTemplateInvocationLifecycleMethodsAreDeclaredCorrectly

      static void validateClassTemplateInvocationLifecycleMethodsAreDeclaredCorrectly(Class<?> testClass, boolean requireStatic, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findAllClassTemplateInvocationLifecycleMethods

      private static Stream<Method> findAllClassTemplateInvocationLifecycleMethods(Class<?> testClass)
    • findMethodsAndCheckStatic

      private static List<Method> findMethodsAndCheckStatic(Class<?> testClass, boolean requireStatic, Class<? extends Annotation> annotationType, org.junit.platform.commons.support.HierarchyTraversalMode traversalMode, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findMethodsAndCheckNonStatic

      private static List<Method> findMethodsAndCheckNonStatic(Class<?> testClass, Class<? extends Annotation> annotationType, org.junit.platform.commons.support.HierarchyTraversalMode traversalMode, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • findMethodsAndCheckVoidReturnType

      private static List<Method> findMethodsAndCheckVoidReturnType(Class<?> testClass, Class<? extends Annotation> annotationType, org.junit.platform.commons.support.HierarchyTraversalMode traversalMode, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<? super Method> additionalCondition)
    • isStatic

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> isStatic(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter, Function<Method,String> annotationNameProvider)
    • isNotStatic

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> isNotStatic(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter, Function<Method,String> annotationNameProvider)
    • isNotPrivateError

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> isNotPrivateError(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • isNotPrivateWarning

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> isNotPrivateWarning(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter, Supplier<String> annotationNameProvider)
    • returnsPrimitiveVoid

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> returnsPrimitiveVoid(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter, Function<Method,String> annotationNameProvider)
    • classTemplateInvocationLifecycleMethodAnnotationName

      private static String classTemplateInvocationLifecycleMethodAnnotationName(Method method)
    • findClassTemplateInvocationLifecycleMethodAnnotation

      private static Optional<org.junit.jupiter.api.extension.ClassTemplateInvocationLifecycleMethod> findClassTemplateInvocationLifecycleMethodAnnotation(Method method)
    • createIssue

      private static org.junit.platform.engine.DiscoveryIssue createIssue(org.junit.platform.engine.DiscoveryIssue.Severity severity, String message, Method method)