@Test public void testConvertCloudResponseNullResponse() { ParseHttpClient restClient = mock(ParseHttpClient.class); ParseCloudCodeController controller = new ParseCloudCodeController(restClient); Object result = controller.convertCloudResponse(null); assertNull(result); }
Object convertCloudResponse(Object result) { if (result instanceof JSONObject) { JSONObject jsonResult = (JSONObject) result; if (jsonResult.isNull("result")) { return null; } result = jsonResult.opt("result"); } ParseDecoder decoder = ParseDecoder.get(); Object finalResult = decoder.decode(result); if (finalResult != null) { return finalResult; } return result; }
ParseCloudCodeController { Object convertCloudResponse(Object result) { if (result instanceof JSONObject) { JSONObject jsonResult = (JSONObject) result; if (jsonResult.isNull("result")) { return null; } result = jsonResult.opt("result"); } ParseDecoder decoder = ParseDecoder.get(); Object finalResult = decoder.decode(result); if (finalResult != null) { return finalResult; } return result; } }
ParseCloudCodeController { Object convertCloudResponse(Object result) { if (result instanceof JSONObject) { JSONObject jsonResult = (JSONObject) result; if (jsonResult.isNull("result")) { return null; } result = jsonResult.opt("result"); } ParseDecoder decoder = ParseDecoder.get(); Object finalResult = decoder.decode(result); if (finalResult != null) { return finalResult; } return result; } ParseCloudCodeController(ParseHttpClient restClient); }
ParseCloudCodeController { Object convertCloudResponse(Object result) { if (result instanceof JSONObject) { JSONObject jsonResult = (JSONObject) result; if (jsonResult.isNull("result")) { return null; } result = jsonResult.opt("result"); } ParseDecoder decoder = ParseDecoder.get(); Object finalResult = decoder.decode(result); if (finalResult != null) { return finalResult; } return result; } ParseCloudCodeController(ParseHttpClient restClient); Task<T> callFunctionInBackground(final String name,
                                                final Map<String, ?> params, String sessionToken); }
ParseCloudCodeController { Object convertCloudResponse(Object result) { if (result instanceof JSONObject) { JSONObject jsonResult = (JSONObject) result; if (jsonResult.isNull("result")) { return null; } result = jsonResult.opt("result"); } ParseDecoder decoder = ParseDecoder.get(); Object finalResult = decoder.decode(result); if (finalResult != null) { return finalResult; } return result; } ParseCloudCodeController(ParseHttpClient restClient); Task<T> callFunctionInBackground(final String name,
                                                final Map<String, ?> params, String sessionToken);  }