RestApiResponseHandler { public static Response getResponseOk() { return Response.ok().cacheControl(cc).build(); }  static Response getResponseOk(); static Response getResponseOk(String msg); static Response getResponseOk(JSONObject jsonObj); static Response getResponse(javax.ws.rs.core.Response.Status status); static Response getResponse(javax.ws.rs.core.Response.Status status, String msg); static Response getResponse(javax.ws.rs.core.Response.Status status, JSONObject jsonObj); static Response getResponse(int status); static Response getResponse(int status , String msg); static Response getResponse(int status, JSONObject jsonObj); static Response getResponseError(javax.ws.rs.core.Response.Status status, Exception e); static Response getResponseError(MESSAGE_KEY key, Exception e, Locale locale); static String getErrorJsonString(String errDesc); static final String CLASS_NAME; static final Logger logger; }
@Test public void getResponseOkTest() { CacheControl cc; cc = new CacheControl(); cc.setNoCache(true); cc.setNoTransform(true); cc.setPrivate(true); assertEquals(RestApiResponseHandler.getResponseOk().getStatus(), 200); assertEquals(RestApiResponseHandler.getResponseOk("String for Test").getStatus() , (Response.ok("String for test").cacheControl(cc).build().getStatus())); JSONObject jo = new JSONObject(); jo.put("status", 200); assertEquals(RestApiResponseHandler.getResponseOk(jo).getStatus() , Response.ok(jo.toString()).cacheControl(cc).build().getStatus()); }