use of org.junit.platform.engine.test.TestEngineSpy in project junit5 by junit-team.
the class DefaultLauncherTests method withoutConfigurationParameters_LookupFallsBackToSystemProperty.
@Test
void withoutConfigurationParameters_LookupFallsBackToSystemProperty() {
System.setProperty(FOO, BAR);
try {
TestEngineSpy engine = new TestEngineSpy();
DefaultLauncher launcher = createLauncher(engine);
launcher.execute(request().build());
ConfigurationParameters configurationParameters = engine.requestForExecution.getConfigurationParameters();
assertThat(configurationParameters.size()).isEqualTo(0);
Optional<String> optionalFoo = configurationParameters.get(FOO);
assertTrue(optionalFoo.isPresent(), "foo should have been picked up via system property");
assertEquals(BAR, optionalFoo.get(), "foo property");
} finally {
System.clearProperty(FOO);
}
}
Aggregations