@Override
  public AppInfo getApp(HttpServletRequest hsr, String appId, Set<String> unselectedFields) {

    try {
      long startTime = clock.getTime();

      // Get SubClusterInfo according to applicationId
      DefaultRequestInterceptorREST interceptor = getOrCreateInterceptorByAppId(appId);
      if (interceptor == null) {
        routerMetrics.incrAppsFailedRetrieved();
        return null;
      }
      AppInfo response = interceptor.getApp(hsr, appId, unselectedFields);
      long stopTime = clock.getTime();
      routerMetrics.succeededAppsRetrieved(stopTime - startTime);
      return response;
    } catch (YarnException e) {
      routerMetrics.incrAppsFailedRetrieved();
      LOG.error("getApp Error, applicationId = {}.", appId, e);
      return null;
    } catch (IllegalArgumentException e) {
      routerMetrics.incrAppsFailedRetrieved();
      throw e;
    }
  }
@Test
  public void testGetApplicationWrongFormat() {

    AppInfo response = interceptor.getApp(null, "Application_wrong_id", null);

    Assert.assertNull(response);
  }