Search in sources :

Example 1 with UriSelector

use of org.junit.platform.engine.discovery.UriSelector in project junit5 by junit-team.

the class DiscoveryRequestCreatorTests method convertsUriSelectors.

@Test
void convertsUriSelectors() {
    options.setSelectedUris(asList(URI.create("a"), URI.create("b")));
    LauncherDiscoveryRequest request = convert();
    List<UriSelector> uriSelectors = request.getSelectorsByType(UriSelector.class);
    assertThat(uriSelectors).extracting(UriSelector::getUri).containsExactly(URI.create("a"), URI.create("b"));
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) UriSelector(org.junit.platform.engine.discovery.UriSelector) Test(org.junit.jupiter.api.Test)

Example 2 with UriSelector

use of org.junit.platform.engine.discovery.UriSelector in project junit5 by junit-team.

the class SuiteLauncherDiscoveryRequestBuilderTests method selectUris.

@Test
void selectUris() {
    @SelectUris("path/to/root")
    class Suite {
    }
    LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
    List<UriSelector> selectors = request.getSelectorsByType(UriSelector.class);
    assertEquals(URI.create("path/to/root"), exactlyOne(selectors).getUri());
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) SelectUris(org.junit.platform.suite.api.SelectUris) UriSelector(org.junit.platform.engine.discovery.UriSelector) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 UriSelector (org.junit.platform.engine.discovery.UriSelector)2 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)2 SelectUris (org.junit.platform.suite.api.SelectUris)1