Class TestMethodTestDescriptor

  • All Implemented Interfaces:
    org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>, org.junit.platform.engine.TestDescriptor
    Direct Known Subclasses:
    TestFactoryTestDescriptor, TestTemplateInvocationTestDescriptor

    @API(status=INTERNAL,
         since="5.0")
    public class TestMethodTestDescriptor
    extends JupiterTestDescriptor
    TestDescriptor for tests based on Java methods.

    Default Display Names

    The default display name for a test method is the name of the method concatenated with a comma-separated list of parameter types in parentheses. The names of parameter types are retrieved using Class.getSimpleName(). For example, the default display name for the following test method is testUser(TestInfo, User).

       @Test
       void testUser(TestInfo testInfo, @Mock User user) { ... }
     
    Since:
    5.0
    • Constructor Detail

      • TestMethodTestDescriptor

        public TestMethodTestDescriptor​(org.junit.platform.engine.UniqueId uniqueId,
                                        java.lang.Class<?> testClass,
                                        java.lang.reflect.Method testMethod)
    • Method Detail

      • getType

        public org.junit.platform.engine.TestDescriptor.Type getType()
      • invokeTestMethod

        protected void invokeTestMethod​(JupiterEngineExecutionContext context,
                                        org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor dynamicTestExecutor)
      • getTags

        public final java.util.Set<org.junit.platform.engine.TestTag> getTags()
        Specified by:
        getTags in interface org.junit.platform.engine.TestDescriptor
        Overrides:
        getTags in class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
      • getExclusiveResources

        public java.util.Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource> getExclusiveResources()
      • getTestClass

        public final java.lang.Class<?> getTestClass()
      • getTestMethod

        public final java.lang.reflect.Method getTestMethod()
      • getLegacyReportingName

        public java.lang.String getLegacyReportingName()