use of com.oracle.bedrock.runtime.concurrent.RemoteCallable in project oracle-bedrock by coherence-community.
the class SimpleJUnitTestRunTest method shouldStartTests.
@Test
public void shouldStartTests() throws Exception {
Platform platform = mock(Platform.class);
JavaApplicationProcess process = mock(JavaApplicationProcess.class);
OptionsByType optionsByType = OptionsByType.empty();
try (SimpleJUnitTestRun application = new SimpleJUnitTestRun(platform, process, optionsByType)) {
TestClasses testClasses = TestClasses.empty();
OptionsByType testOptions = OptionsByType.of(testClasses);
SimpleJUnitTestRun spyApp = spy(application);
doReturn(null).when(spyApp).submit(any(RemoteCallable.class), anyVararg());
spyApp.startTests(testOptions);
ArgumentCaptor<RemoteCallable> captorCallable = ArgumentCaptor.forClass(RemoteCallable.class);
verify(spyApp).submit(captorCallable.capture(), anyVararg());
RemoteCallable callable = captorCallable.getValue();
assertThat(callable, is(instanceOf(JUnitTestRunner.StartTests.class)));
JUnitTestRunner.StartTests startTests = (JUnitTestRunner.StartTests) callable;
assertThat(startTests.getOptions(), is(arrayContainingInAnyOrder(testClasses)));
}
}
Aggregations