@Test public void testFailingDeleteAsync() throws Exception { JSONObject mockResponse = new JSONObject(); mockResponse.put("code", 141); mockResponse.put("error", "Delete is not allowed"); ParseHttpClient restClient = ParseTestUtils.mockParseHttpClientWithResponse(mockResponse, 400, "Bad Request"); ParseObject.State state = new ParseObject.State.Builder("Test") .objectId("testObjectId") .build(); NetworkObjectController controller = new NetworkObjectController(restClient); thrown.expect(ParseException.class); thrown.expectMessage("Delete is not allowed"); ParseTaskUtils.wait(controller.deleteAsync(state, "sessionToken")); }
@Override public Task<Void> deleteAsync(ParseObject.State state, String sessionToken) { ParseRESTObjectCommand command = ParseRESTObjectCommand.deleteObjectCommand( state, sessionToken); return command.executeAsync(client).makeVoid(); }
NetworkObjectController implements ParseObjectController { @Override public Task<Void> deleteAsync(ParseObject.State state, String sessionToken) { ParseRESTObjectCommand command = ParseRESTObjectCommand.deleteObjectCommand( state, sessionToken); return command.executeAsync(client).makeVoid(); } }
NetworkObjectController implements ParseObjectController { @Override public Task<Void> deleteAsync(ParseObject.State state, String sessionToken) { ParseRESTObjectCommand command = ParseRESTObjectCommand.deleteObjectCommand( state, sessionToken); return command.executeAsync(client).makeVoid(); } NetworkObjectController(ParseHttpClient client); }
NetworkObjectController implements ParseObjectController { @Override public Task<Void> deleteAsync(ParseObject.State state, String sessionToken) { ParseRESTObjectCommand command = ParseRESTObjectCommand.deleteObjectCommand( state, sessionToken); return command.executeAsync(client).makeVoid(); } NetworkObjectController(ParseHttpClient client); @Override Task<ParseObject.State> fetchAsync(
            final ParseObject.State state, String sessionToken, final ParseDecoder decoder); @Override Task<ParseObject.State> saveAsync(
            final ParseObject.State state,
            final ParseOperationSet operations,
            String sessionToken,
            final ParseDecoder decoder); @Override List<Task<ParseObject.State>> saveAllAsync(
            List<ParseObject.State> states,
            List<ParseOperationSet> operationsList,
            String sessionToken,
            List<ParseDecoder> decoders); @Override Task<Void> deleteAsync(ParseObject.State state, String sessionToken); @Override List<Task<Void>> deleteAllAsync(
            List<ParseObject.State> states, String sessionToken); }
NetworkObjectController implements ParseObjectController { @Override public Task<Void> deleteAsync(ParseObject.State state, String sessionToken) { ParseRESTObjectCommand command = ParseRESTObjectCommand.deleteObjectCommand( state, sessionToken); return command.executeAsync(client).makeVoid(); } NetworkObjectController(ParseHttpClient client); @Override Task<ParseObject.State> fetchAsync(
            final ParseObject.State state, String sessionToken, final ParseDecoder decoder); @Override Task<ParseObject.State> saveAsync(
            final ParseObject.State state,
            final ParseOperationSet operations,
            String sessionToken,
            final ParseDecoder decoder); @Override List<Task<ParseObject.State>> saveAllAsync(
            List<ParseObject.State> states,
            List<ParseOperationSet> operationsList,
            String sessionToken,
            List<ParseDecoder> decoders); @Override Task<Void> deleteAsync(ParseObject.State state, String sessionToken); @Override List<Task<Void>> deleteAllAsync(
            List<ParseObject.State> states, String sessionToken);  }