use of org.junit.platform.engine.DiscoverySelector in project cucumber-jvm by cucumber.
the class DiscoverySelectorResolverTest method resolveRequestWithFileSelector.
@Test
void resolveRequestWithFileSelector() {
DiscoverySelector resource = selectFile("src/test/resources/io/cucumber/junit/platform/engine/single.feature");
EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
resolver.resolveSelectors(discoveryRequest, testDescriptor);
assertEquals(1, testDescriptor.getChildren().size());
}
use of org.junit.platform.engine.DiscoverySelector in project cucumber-jvm by cucumber.
the class DiscoverySelectorResolverTest method resolveRequestWithMultipleUniqueIdSelector.
@Test
void resolveRequestWithMultipleUniqueIdSelector() {
Set<UniqueId> selectors = new HashSet<>();
DiscoverySelector resource = selectDirectory("src/test/resources/io/cucumber/junit/platform/engine/feature-with-outline.feature");
selectSomePickle(resource).ifPresent(selectors::add);
DiscoverySelector resource2 = selectDirectory("src/test/resources/io/cucumber/junit/platform/engine/single.feature");
selectSomePickle(resource2).ifPresent(selectors::add);
EngineDiscoveryRequest discoveryRequest = new SelectorRequest(selectors.stream().map(DiscoverySelectors::selectUniqueId).collect(Collectors.toList()));
resolver.resolveSelectors(discoveryRequest, testDescriptor);
assertEquals(selectors, testDescriptor.getDescendants().stream().filter(PickleDescriptor.class::isInstance).map(TestDescriptor::getUniqueId).collect(toSet()));
}
Aggregations