ConnectionContext jmsContext = getConnectionContext();
Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = jmsContext.createConsumer(session, slaListener.getTopic(durationMiss));
slaListener.onDurationMiss(durationMiss);
TextMessage message = (TextMessage) consumer.receive(5000);
SLAMessage durationMissMsg = (SLAMessage) JMSMessagingUtils.getEventMessage(message);
// check msg header
assertEquals(EventStatus.DURATION_MISS, durationMissMsg.getEventStatus());
assertEquals(SLAStatus.IN_PROCESS, durationMissMsg.getSLAStatus());
assertEquals(AppType.COORDINATOR_ACTION, durationMissMsg.getAppType());
assertEquals(MessageType.SLA, durationMissMsg.getMessageType());
assertEquals("Test-SLA-Duration-Miss", durationMissMsg.getAppName());
assertEquals("dummyuser", durationMissMsg.getUser());
// check msg body
assertEquals("0000000-000000000000001-oozie-wrkf-C@1", durationMissMsg.getId());
assertEquals("0000000-000000000000001-oozie-wrkf-C", durationMissMsg.getParentId());
assertEquals(expectedStartDate, durationMissMsg.getExpectedStartTime());
assertEquals(actualStartDate, durationMissMsg.getActualStartTime());
assertEquals(expectedEndDate, durationMissMsg.getExpectedEndTime());
assertEquals(actualEndDate, durationMissMsg.getActualEndTime());
assertEquals(expectedDuration, durationMissMsg.getExpectedDuration());
assertEquals(actualDuration, durationMissMsg.getActualDuration());
assertEquals("notification of duration miss", durationMissMsg.getNotificationMessage());
}