HeartBeat heartBeat = constructHeartBeat("newHost", registrationResponse.getResponseId(), Status.HEALTHY);
HeartBeatResponse hbResponse = heartBeatHandler.handleHeartBeat(heartBeat);
assertEquals("responseId was not incremented", 1L, hbResponse.getResponseId());
assertTrue("Not cached response returned", hbResponse == heartBeatHandler.handleHeartBeat(heartBeat));
heartBeat.setResponseId(1L);
hbResponse = heartBeatHandler.handleHeartBeat(heartBeat);
assertEquals("responseId was not incremented", 2L, hbResponse.getResponseId());
assertFalse("Agent is flagged for restart", hbResponse.isRestartAgent());