Class IsTestFactoryMethod

java.lang.Object
org.junit.jupiter.engine.discovery.predicates.IsTestableMethod
org.junit.jupiter.engine.discovery.predicates.IsTestFactoryMethod
All Implemented Interfaces:
Predicate<Method>

@API(status=INTERNAL, since="5.0") public class IsTestFactoryMethod extends IsTestableMethod
Test if a method is a JUnit Jupiter @TestFactory method.

NOTE: this predicate does not check if a candidate method has an appropriate return type for a @TestFactory method.

Since:
5.0
  • Field Details

    • EXPECTED_RETURN_TYPE_MESSAGE

      private static final String EXPECTED_RETURN_TYPE_MESSAGE
  • Constructor Details

    • IsTestFactoryMethod

      public IsTestFactoryMethod(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
  • Method Details

    • hasCompatibleReturnType

      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<Method> hasCompatibleReturnType(Class<? extends Annotation> annotationType, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • isCompatible

      private static boolean isCompatible(Method method, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • isCompatibleContainerType

      private static boolean isCompatibleContainerType(Method method, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)
    • createTooGenericReturnTypeIssue

      private static org.junit.platform.engine.DiscoveryIssue.Builder createTooGenericReturnTypeIssue(Method method)