use of org.junit.platform.engine.TestDescriptor.Type 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