CommandProcessor implements RestProcessor { public void dispose() { commands.dispose(); notifier.shutdown(); notifierPool.shutdown(); } CommandProcessor( final HostRegistry hostRegistry, final IdentityManager identityManager ); void addListener( HeartbeatListener listener ); void removeListener( HeartbeatListener listener ); void dispose(); @Override void handleHeartbeat( final HeartBeat heartBeat ); @Override Set<String> getRequests( final String hostId ); @Override void handleResponse( final Response response );  }
@Test public void testDispose() throws Exception { commandProcessor.dispose(); verify( commands ).dispose(); verify( notifierPool ).shutdown(); }