@Override
  public FetchedAppReport getApplicationReport(ApplicationId appId)
      throws YarnException, IOException {
    SubClusterId scid = federationFacade.getApplicationHomeSubCluster(appId);
    createSubclusterIfAbsent(scid);
    ApplicationClientProtocol applicationsManager = subClusters.get(scid).getRight();

    return super.getApplicationReport(applicationsManager, appId);
  }
@Test
  public void testFetchReportAHSDisabled() throws Exception {
    testHelper(false);

    /* RM will not know of the app and Application History Service is disabled
     * So we will not try to get the report from AHS and RM will throw
     * ApplicationNotFoundException
     */
    LambdaTestUtils.intercept(ApplicationNotFoundException.class, appNotFoundExceptionMsg,
        () -> fetcher.getApplicationReport(appId1));
    LambdaTestUtils.intercept(ApplicationNotFoundException.class, appNotFoundExceptionMsg,
        () -> fetcher.getApplicationReport(appId2));

    Mockito.verify(appManager1, Mockito.times(1))
        .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
    Mockito.verify(appManager2, Mockito.times(1))
        .getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
    Assert.assertNull("HistoryManager should be null as AHS is disabled", history);
  }