NCMBPush extends NCMBBase { public void deleteInBackground() { deleteInBackground(null); } NCMBPush();   NCMBPush(JSONObject params); Date getDeliveryTime(); JSONArray getTarget(); JSONObject getSearchCondition(); String getMessage(); JSONObject getUserSettingValue(); Date getDeliveryExpirationDate(); String getDeliveryExpirationTime(); int getDeliveryPlanNumber(); int getDeliveryNumber(); int getStatus(); JSONObject getError(); String getAction(); Boolean getBadgeIncrementFlag(); String getSound(); Boolean getContentAvailable(); String getTitle(); Boolean getDialog(); String getRichUrl(); int getBadgeSetting(); String getCategory(); void setDeliveryTime(Date value); void setTarget(JSONArray value); void setSearchCondition(NCMBQuery<NCMBInstallation> query); void setMessage(String value); void setUserSettingValue(JSONObject value); void setDeliveryExpirationDate(Date value); void setDeliveryExpirationTime(String value); void setAction(String value); void setBadgeIncrementFlag(Boolean value); void setSound(String value); void setContentAvailable(Boolean value); void setTitle(String value); void setDialog(Boolean value); void setRichUrl(String value); void setBadgeSetting(Integer value); void setCategory(String value); static NCMBQuery<NCMBPush> getQuery(); void send(); void sendInBackground(); void sendInBackground(final DoneCallback callback); void fetch(); void fetchInBackground(); void fetchInBackground(final FetchCallback callback); void delete(); void deleteInBackground(); void deleteInBackground(final DoneCallback callback); static void richPushHandler(Context context, Intent intent); static void trackAppOpened(Intent intent); static void dialogPushHandler(Context context, Bundle bundle, NCMBDialogPushConfiguration dialogPushConfiguration);  }
@Test public void deleteInBackground() throws Exception { Assert.assertFalse(callbackFlag); NCMBPush push = new NCMBPush(); push.setObjectId("7FrmPTBKSNtVjajm"); push.deleteInBackground(new DoneCallback() { @Override public void done(NCMBException e) { Assert.assertNull(e); callbackFlag = true; } }); Robolectric.flushBackgroundThreadScheduler(); ShadowLooper.runUiThreadTasks(); Assert.assertTrue(callbackFlag); Assert.assertNull(push.getObjectId()); }
@Test public void deleteInBackground_none_callback() throws Exception { NCMBPush push = new NCMBPush(); push.setObjectId("7FrmPTBKSNtVjajm"); push.deleteInBackground(); Robolectric.flushBackgroundThreadScheduler(); ShadowLooper.runUiThreadTasks(); Assert.assertNull(push.getObjectId()); }