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 MethodBasedTestDescriptor
    TestDescriptor for @Test 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,
                                        JupiterConfiguration configuration)
    • 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)
      • nodeSkipped

        public void nodeSkipped​(JupiterEngineExecutionContext context,
                                org.junit.platform.engine.TestDescriptor descriptor,
                                org.junit.platform.engine.support.hierarchical.Node.SkipResult result)
        Invoke TestWatcher.testDisabled(ExtensionContext, Optional) on each registered TestWatcher, in registration order.
        Since:
        5.4
      • nodeFinished

        public void nodeFinished​(JupiterEngineExecutionContext context,
                                 org.junit.platform.engine.TestDescriptor descriptor,
                                 org.junit.platform.engine.TestExecutionResult result)
        Invoke testSuccessful(), testAborted(), or testFailed() on each registered TestWatcher according to the status of the supplied TestExecutionResult, in reverse registration order.
        Since:
        5.4