HeartbeatProcessor implements HeartbeatListener { @Override public void onHeartbeat( final HeartBeat heartBeat ) { registry.registerHost( heartBeat.getHostInfo(), heartBeat.getAlerts() ); } HeartbeatProcessor( final HostRegistryImpl registry ); @Override void onHeartbeat( final HeartBeat heartBeat );  }
@Test public void onHeartbeat() throws Exception { heartbeatProcessor.onHeartbeat( heartBeat ); verify( hostRegistry ).registerHost( any( ResourceHostInfo.class ), anySet() ); verify( heartBeat ).getHostInfo(); verify( heartBeat ).getAlerts(); }