NCMBPush extends NCMBBase { public void send() throws NCMBException { NCMBPushService pushService = (NCMBPushService) NCMB.factory(NCMB.ServiceType.PUSH); JSONObject responseData; if (getObjectId() == null) { responseData = pushService.sendPush(mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = pushService.updatePush(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); } 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 send_post() throws Exception { NCMBException error = null; NCMBPush push = new NCMBPush(); try { push.send(); } catch (NCMBException e) { error = e; } Assert.assertNull(error); Assert.assertEquals("7FrmPTBKSNtVjajm", push.getObjectId()); DateFormat format = NCMBDateFormat.getIso8601(); Assert.assertEquals(format.parse("2014-06-03T11:28:30.348Z"), push.getCreateDate()); }