use of org.junit.platform.engine.TestTag in project junit5 by junit-team.
the class JUnitPlatformRunnerTests method testDescriptorWithTags.
private TestDescriptor testDescriptorWithTags(String... tag) {
TestDescriptor testDescriptor = mock(TestDescriptor.class);
Set<TestTag> tags = Arrays.stream(tag).map(TestTag::create).collect(toSet());
when(testDescriptor.getTags()).thenReturn(tags);
return testDescriptor;
}
use of org.junit.platform.engine.TestTag in project junit5 by junit-team.
the class TestIdentifier method from.
/**
* Factory for creating a new {@link TestIdentifier} from a {@link TestDescriptor}.
*/
@API(status = INTERNAL, since = "1.0")
public static TestIdentifier from(TestDescriptor testDescriptor) {
Preconditions.notNull(testDescriptor, "TestDescriptor must not be null");
String uniqueId = testDescriptor.getUniqueId().toString();
String displayName = testDescriptor.getDisplayName();
TestSource source = testDescriptor.getSource().orElse(null);
Set<TestTag> tags = testDescriptor.getTags();
Type type = testDescriptor.getType();
String parentId = testDescriptor.getParent().map(parentDescriptor -> parentDescriptor.getUniqueId().toString()).orElse(null);
String legacyReportingName = testDescriptor.getLegacyReportingName();
return new TestIdentifier(uniqueId, displayName, source, tags, type, parentId, legacyReportingName);
}
Aggregations