AHSv2ClientImpl extends AHSClient { @Override public ApplicationAttemptReport getApplicationAttemptReport( ApplicationAttemptId applicationAttemptId) throws YarnException, IOException { TimelineEntity entity = readerClient.getApplicationAttemptEntity( applicationAttemptId, "ALL", null); return TimelineEntityV2Converter.convertToApplicationAttemptReport(entity); } AHSv2ClientImpl(); @Override void serviceInit(Configuration conf); @Override void serviceStart(); @Override void serviceStop(); @Override ApplicationReport getApplicationReport(ApplicationId appId); @Override List<ApplicationReport> getApplications(); @Override ApplicationAttemptReport getApplicationAttemptReport(
      ApplicationAttemptId applicationAttemptId); @Override List<ApplicationAttemptReport> getApplicationAttempts(
      ApplicationId applicationId); @Override ContainerReport getContainerReport(ContainerId containerId); @Override List<ContainerReport> getContainers(ApplicationAttemptId
      applicationAttemptId);  }
@Test public void testGetAppAttemptReport() throws IOException, YarnException { final ApplicationId appId = ApplicationId.newInstance(0, 1); final ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); when(spyTimelineReaderClient.getApplicationAttemptEntity(appAttemptId, "ALL", null)) .thenReturn(createAppAttemptTimelineEntity(appAttemptId)); ApplicationAttemptReport report = client.getApplicationAttemptReport(appAttemptId); assertThat(report.getApplicationAttemptId()).isEqualTo(appAttemptId); assertThat(report.getFinishTime()).isEqualTo(Integer.MAX_VALUE + 2L); assertThat(report.getOriginalTrackingUrl()). isEqualTo("test original tracking url"); }