// sleep a little to let nagios stub process the payloads
Thread.sleep(2000);
assertEquals(2, nagios.getMessagePayloadList().size());
MessagePayload payload = nagios.getMessagePayloadList().get(0);
assertEquals("Hello Nagios", payload.getMessage());
assertEquals("localhost", payload.getHostname());
assertEquals(Level.OK.ordinal(), payload.getLevel());
assertEquals(context.getName(), payload.getServiceName());
payload = nagios.getMessagePayloadList().get(1);
assertEquals("Bye Nagios", payload.getMessage());
assertEquals("localhost", payload.getHostname());
assertEquals(Level.OK.ordinal(), payload.getLevel());
assertEquals(context.getName(), payload.getServiceName());
}