@Test public void testStopAsyncShouldStopWebAppServer() { ArgumentCaptor<Runnable> captor = ArgumentCaptor.forClass(Runnable.class); underTest.stopAsync(); verify(executorService).execute(captor.capture()); captor.getValue().run(); verify(webAppServer).stop(); }
public void stopAsync() { executorService.execute(task); executorService.shutdown(); }
WebAppStopper { public void stopAsync() { executorService.execute(task); executorService.shutdown(); } }
WebAppStopper { public void stopAsync() { executorService.execute(task); executorService.shutdown(); } WebAppStopper(final WebAppServer webAppServer, final ExecutorService executorService); }
WebAppStopper { public void stopAsync() { executorService.execute(task); executorService.shutdown(); } WebAppStopper(final WebAppServer webAppServer, final ExecutorService executorService); void stopAsync(); }
WebAppStopper { public void stopAsync() { executorService.execute(task); executorService.shutdown(); } WebAppStopper(final WebAppServer webAppServer, final ExecutorService executorService); void stopAsync();  }