@Test
public void testPublishContainerResumedEvent() {

  ApplicationId appId = ApplicationId.newInstance(0, 1);
  ApplicationAttemptId appAttemptId =
      ApplicationAttemptId.newInstance(appId, 1);
  ContainerId cId = ContainerId.newContainerId(appAttemptId, 1);
  ContainerEvent containerEvent =
      new ContainerResumeEvent(cId, "test resume");
  publisher.createTimelineClient(appId);
  publisher.publishContainerEvent(containerEvent);
  publisher.stopTimelineClient(appId);
  dispatcher.await();
  ContainerEntity cEntity = new ContainerEntity();
  cEntity.setId(cId.toString());
  TimelineEntity[] lastPublishedEntities =
      timelineClient.getLastPublishedEntities();
  Assert.assertNotNull(lastPublishedEntities);
  Assert.assertEquals(1, lastPublishedEntities.length);
  TimelineEntity entity = lastPublishedEntities[0];
  Assert.assertEquals(cEntity, entity);
  NavigableSet<TimelineEvent> events = entity.getEvents();
  Assert.assertEquals(1, events.size());
  Assert.assertEquals(ContainerMetricsConstants.RESUMED_EVENT_TYPE,
      events.iterator().next().getId());
  Map<String, Object> info = entity.getInfo();
  Assert.assertTrue(
      info.containsKey(ContainerMetricsConstants.DIAGNOSTICS_INFO));
  Assert.assertEquals("test resume",
      info.get(ContainerMetricsConstants.DIAGNOSTICS_INFO));
}