@Test public void testHandleFetchResultAsync() throws Exception { ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); when(controller.setAsync(any(ParseInstallation.class))).thenReturn(Task.<Void>forResult(null)); ParseCorePlugins.getInstance().registerCurrentInstallationController(controller); ParseInstallation.State state = new ParseInstallation.State.Builder("_Installation") .put("key", "value") .isComplete(true) .build(); ParseInstallation installation = new ParseInstallation(); ParseTaskUtils.wait(installation.handleFetchResultAsync(state)); assertEquals("value", installation.get("key")); verify(controller, times(1)).setAsync(installation); }
@Override Task<Void> handleFetchResultAsync(final ParseObject.State newState) { return super.handleFetchResultAsync(newState).onSuccessTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return getCurrentInstallationController().setAsync(ParseInstallation.this); } }); }
ParseInstallation extends ParseObject { @Override Task<Void> handleFetchResultAsync(final ParseObject.State newState) { return super.handleFetchResultAsync(newState).onSuccessTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return getCurrentInstallationController().setAsync(ParseInstallation.this); } }); } }
ParseInstallation extends ParseObject { @Override Task<Void> handleFetchResultAsync(final ParseObject.State newState) { return super.handleFetchResultAsync(newState).onSuccessTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return getCurrentInstallationController().setAsync(ParseInstallation.this); } }); } ParseInstallation(); }
ParseInstallation extends ParseObject { @Override Task<Void> handleFetchResultAsync(final ParseObject.State newState) { return super.handleFetchResultAsync(newState).onSuccessTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return getCurrentInstallationController().setAsync(ParseInstallation.this); } }); } ParseInstallation(); static ParseInstallation getCurrentInstallation(); static ParseQuery<ParseInstallation> getQuery(); String getInstallationId(); @Override void setObjectId(String newObjectId); String getPushType(); void setPushType(String pushType); String getDeviceToken(); void setDeviceToken(String deviceToken); }
ParseInstallation extends ParseObject { @Override Task<Void> handleFetchResultAsync(final ParseObject.State newState) { return super.handleFetchResultAsync(newState).onSuccessTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return getCurrentInstallationController().setAsync(ParseInstallation.this); } }); } ParseInstallation(); static ParseInstallation getCurrentInstallation(); static ParseQuery<ParseInstallation> getQuery(); String getInstallationId(); @Override void setObjectId(String newObjectId); String getPushType(); void setPushType(String pushType); String getDeviceToken(); void setDeviceToken(String deviceToken);  }