@Test
public 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);
    Assert.fail("Exception should have been thrown before we reach here.");
  } catch (ApplicationNotFoundException e) {
    //This exception is expected.
    Assert.assertTrue(e.getMessage().contains(
        "doesn't exist in the timeline store"));
  } catch (Exception e) {
    Assert.fail("Undesired exception caught");
  }
}