@Override
  public ContainerReport getContainerReport(ContainerId containerId)
      throws YarnException, IOException {
    ApplicationReport appReport = getApplicationReport(
        containerId.getApplicationAttemptId().getApplicationId());
    TimelineEntity entity = readerClient.getContainerEntity(containerId,
        "ALL", null);
    return TimelineEntityV2Converter.convertToContainerReport(
        entity, logServerUrl, appReport.getUser());
  }
@Test
  public void testGetContainerReport() throws IOException, YarnException {
    final ApplicationId appId = ApplicationId.newInstance(0, 1);
    final ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
    final ContainerId containerId = ContainerId.newContainerId(appAttemptId, 1);
    when(spyTimelineReaderClient.getContainerEntity(containerId, "ALL", null))
        .thenReturn(createContainerEntity(containerId));
    when(spyTimelineReaderClient.getApplicationEntity(appId, "ALL", null))
        .thenReturn(createApplicationTimelineEntity(appId, true, false));
    ContainerReport report = client.getContainerReport(containerId);
    assertThat(report.getContainerId()).isEqualTo(containerId);
    assertThat(report.getAssignedNode().getHost()).isEqualTo("test host");
    assertThat(report.getAssignedNode().getPort()).isEqualTo(100);
    assertThat(report.getAllocatedResource().getVirtualCores()).isEqualTo(8);
    assertThat(report.getCreationTime()).isEqualTo(123456);
    assertThat(report.getLogUrl()).isEqualTo("https://localhost:8188/ahs/logs/"
        + "test host:100/container_0_0001_01_000001/"
        + "container_0_0001_01_000001/user1");
  }