PublicRestApi { @GET @Path("/{app_id}/policy/status") @Produces (MediaType.APPLICATION_JSON) public Response getPolicyStatus(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id) { String policyStatus; try{ Map<String, String> service_info = getserverinfo(app_id); policyStatus = service_info.get("status"); if ((policyStatus != null) && (policyStatus.length() > 0)){ return RestApiResponseHandler.getResponseJsonOk("{\"status\":" + "\"" + policyStatus.toUpperCase() + "\"}"); } else { return RestApiResponseHandler.getResponsePolicyNotExistError(new PolicyNotFoundException(app_id), LocaleUtil.getLocale(httpServletRequest)); } } catch (CloudException e) { return RestApiResponseHandler.getResponseCloudError(e, LocaleUtil.getLocale(httpServletRequest)); } catch (AppNotFoundException e){ return RestApiResponseHandler.getResponseAppNotFound(e, LocaleUtil.getLocale(httpServletRequest)); } catch (ServiceNotFoundException e){ return RestApiResponseHandler.getResponseServiceNotFound(e, LocaleUtil.getLocale(httpServletRequest)); } catch (InternalAuthenticationException e) { return RestApiResponseHandler.getResponseInternalAuthenticationFail(e, LocaleUtil.getLocale(httpServletRequest)); } catch (Exception e) { logger.info("error in getserverinfo: " + e.getMessage()); return RestApiResponseHandler.getResponseInternalServerError(new InternalServerErrorException(MessageUtil.RestResponseErrorMsg_retrieve_application_service_information_context, e), LocaleUtil.getLocale(httpServletRequest)); } }  static PublicRestApi getInstance(); @PUT @Path("/{app_id}/policy") @Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response createPolicy(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id, String jsonString); @DELETE @Path("/{app_id}/policy") // @Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response deletePolicy(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id, String jsonString); @GET @Path("/{app_id}/policy") //@Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response getPolicy(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id); @PUT @Path("/{app_id}/policy/status") @Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response enablePolicy(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id, String jsonString); @GET @Path("/{app_id}/policy/status") //@Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response getPolicyStatus(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id); @GET @Path("/{app_id}/scalinghistory") //@Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response getHistory(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id, 
    		@QueryParam ("startTime") String startTime, @QueryParam ("endTime") String endTime); @GET @Path("/{app_id}/metrics") //@Consumes(MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) Response getMetrics(@Context final HttpServletRequest httpServletRequest, @PathParam("app_id") String app_id, 
    		@QueryParam ("startTime") String startTime, @QueryParam ("endTime") String endTime); Map<String, String> getserverinfo(String app_id);  }
@Test public void getPolicyStatusTest(){ WebResource webResource = resource(); ClientResponse response = webResource.path("/apps/" + TESTAPPID + "/policy/status").type(MediaType.APPLICATION_JSON).get(ClientResponse.class); assertEquals(response.getStatus(), STATUS200); }