@Test
public void testContainerReport() throws IOException, YarnException {

  ApplicationId appId = ApplicationId.newInstance(0, 1);
  writeApplicationStartData(appId);
  ApplicationAttemptId appAttemptId =
      ApplicationAttemptId.newInstance(appId, 1);
  ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
  writeContainerStartData(containerId);
  writeContainerFinishData(containerId);
  writeApplicationFinishData(appId);
  GetContainerReportRequest request =
      GetContainerReportRequest.newInstance(containerId);
  GetContainerReportResponse response =
      historyServer.getClientService().getClientHandler()
        .getContainerReport(request);
  ContainerReport container = response.getContainerReport();
  Assert.assertNotNull(container);
  Assert.assertEquals(containerId, container.getContainerId());
  Assert.assertEquals(expectedLogUrl, container.getLogUrl());
}