Search in sources :

Example 6 with TestMethodTestDescriptor

use of org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor in project junit5 by junit-team.

the class RunListenerAdapterTests method displayNamesIgnoredInReport.

@Test
void displayNamesIgnoredInReport() throws NoSuchMethodException {
    TestMethodTestDescriptor descriptor = new TestMethodTestDescriptor(newId(), MyTestClass.class, MyTestClass.class.getDeclaredMethod("myNamedTestMethod"));
    TestIdentifier factoryIdentifier = TestIdentifier.from(descriptor);
    ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass(ReportEntry.class);
    adapter.executionSkipped(factoryIdentifier, "");
    verify(listener).testSkipped(entryCaptor.capture());
    ReportEntry value = entryCaptor.getValue();
    assertEquals("myNamedTestMethod", value.getName());
}
Also used : ReportEntry(org.apache.maven.surefire.report.ReportEntry) SimpleReportEntry(org.apache.maven.surefire.report.SimpleReportEntry) TestIdentifier(org.junit.platform.launcher.TestIdentifier) TestMethodTestDescriptor(org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor) Test(org.junit.jupiter.api.Test)

Aggregations

TestMethodTestDescriptor (org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor)6 Method (java.lang.reflect.Method)4 Test (org.junit.jupiter.api.Test)4 ClassExtensionContext (org.junit.jupiter.engine.descriptor.ClassExtensionContext)4 ClassTestDescriptor (org.junit.jupiter.engine.descriptor.ClassTestDescriptor)4 MethodExtensionContext (org.junit.jupiter.engine.descriptor.MethodExtensionContext)4 NestedClassTestDescriptor (org.junit.jupiter.engine.descriptor.NestedClassTestDescriptor)4 DynamicTest (org.junit.jupiter.api.DynamicTest)3 DynamicTest.dynamicTest (org.junit.jupiter.api.DynamicTest.dynamicTest)3 JupiterEngineDescriptor (org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor)3 JupiterEngineExtensionContext (org.junit.jupiter.engine.descriptor.JupiterEngineExtensionContext)3 UniqueId (org.junit.platform.engine.UniqueId)3 TestFactory (org.junit.jupiter.api.TestFactory)2 ExtensionContext (org.junit.jupiter.api.extension.ExtensionContext)2 ConfigurationParameters (org.junit.platform.engine.ConfigurationParameters)2 Collections (java.util.Collections)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Stream (java.util.stream.Stream)1 ReportEntry (org.apache.maven.surefire.report.ReportEntry)1