MessageSender { public void dispose() { restExecutor.shutdown(); mainLoopExecutor.shutdown(); } MessageSender( final MessengerDataService messengerDataService, final MessengerImpl messenger ); void init(); void dispose(); static final int SLEEP_BETWEEN_ITERATIONS_SEC; }
@Test public void testDispose() throws Exception { messageSender.dispose(); verify( restExecutor ).shutdown(); verify( mainLoopExecutor ).shutdown(); }