ApiServiceClient extends AppAdminClient { @Override public String getStatusString(String appIdOrName) throws IOException, YarnException { String output = ""; String appName; try { ApplicationId appId = ApplicationId.fromString(appIdOrName); ApplicationReport appReport = yarnClient.getApplicationReport(appId); appName = appReport.getName(); } catch (IllegalArgumentException e) { appName = appIdOrName; ServiceApiUtil.validateNameFormat(appName, getConfig()); } try { ClientResponse response = getApiClient(getServicePath(appName)) .get(ClientResponse.class); if (response.getStatus() == 404) { StringBuilder sb = new StringBuilder(); sb.append(" Service "); sb.append(appName); sb.append(" not found"); return sb.toString(); } if (response.getStatus() != 200) { StringBuilder sb = new StringBuilder(); sb.append(appName); sb.append(" Failed : HTTP error code : "); sb.append(response.getStatus()); return sb.toString(); } output = response.getEntity(String.class); } catch (Exception e) { LOG.error("Fail to check application status: ", e); } return output; }  Service loadAppJsonFromLocalFS(String fileName, String serviceName,
      Long lifetime, String queue); @Override int actionLaunch(String fileName, String appName, Long lifetime,
      String queue); @Override int actionStop(String appName); @Override int actionStart(String appName); @Override int actionSave(String fileName, String appName, Long lifetime,
      String queue); @Override int actionDestroy(String appName); @Override int actionFlex(String appName, Map<String, String> componentCounts); @Override int enableFastLaunch(String destinationFolder); @Override String getStatusString(String appIdOrName); @Override int actionUpgradeExpress(String appName, File path); @Override int initiateUpgrade(String appName,
      String fileName, boolean autoFinalize); @Override int actionUpgradeInstances(String appName, List<String> compInstances); @Override int actionUpgradeComponents(String appName, List<String> components); @Override int actionCleanUp(String appName, String userName); @Override String getInstances(String appName, List<String> components,
      String version, List<String> containerStates); @Override int actionCancelUpgrade(
      String appName);  }
@Test public void testStatus() { String appName = "nonexistent-app"; try { String result = asc.getStatusString(appName); assertEquals("Status reponse don't match", " Service " + appName + " not found", result); } catch (IOException | YarnException e) { fail(); } }