@Override
  public GetApplicationReportResponse getApplicationReport(
      GetApplicationReportRequest request) throws YarnException, IOException {
    ApplicationId applicationId = request.getApplicationId();
    try {
      GetApplicationReportResponse response =
          GetApplicationReportResponse.newInstance(history
            .getApplication(applicationId));
      return response;
    } catch (IOException e) {
      LOG.error(e.getMessage(), e);
      throw e;
    }
  }
@Test
  void testApplicationNotFound() throws IOException, YarnException {
    ApplicationId appId = null;
    appId = ApplicationId.newInstance(0, MAX_APPS + 1);
    GetApplicationReportRequest request =
        GetApplicationReportRequest.newInstance(appId);
    try {
      @SuppressWarnings("unused")
      GetApplicationReportResponse response =
          clientService.getApplicationReport(request);
      fail("Exception should have been thrown before we reach here.");
    } catch (ApplicationNotFoundException e) {
      //This exception is expected.
      assertTrue(e.getMessage().contains(
          "doesn't exist in the timeline store"));
    } catch (Exception e) {
      fail("Undesired exception caught");
    }
  }