Class IsTestFactoryMethod

  • All Implemented Interfaces:
    java.util.function.Predicate<java.lang.reflect.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
    • Constructor Summary

      Constructors 
      Constructor Description
      IsTestFactoryMethod​(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static org.junit.platform.engine.DiscoveryIssue.Builder createTooGenericReturnTypeIssue​(java.lang.reflect.Method method)  
      private static org.junit.platform.engine.support.discovery.DiscoveryIssueReporter.Condition<java.lang.reflect.Method> hasCompatibleReturnType​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)  
      private static boolean isCompatible​(java.lang.reflect.Method method, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)  
      private static boolean isCompatibleContainerType​(java.lang.reflect.Method method, org.junit.platform.engine.support.discovery.DiscoveryIssueReporter issueReporter)  
      • 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.Predicate

        and, negate, or
    • Field Detail

      • EXPECTED_RETURN_TYPE_MESSAGE

        private static final java.lang.String EXPECTED_RETURN_TYPE_MESSAGE
    • Constructor Detail

      • IsTestFactoryMethod

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

      • hasCompatibleReturnType

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

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

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

        private static org.junit.platform.engine.DiscoveryIssue.Builder createTooGenericReturnTypeIssue​(java.lang.reflect.Method method)