@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");
}