NCMBRole extends NCMBBase { public void fetchObject() throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); NCMBRole role = roleService.fetchRole(getObjectId()); if (role != null) { mFields = role.mFields; } } NCMBRole();  NCMBRole(String name);   NCMBRole(JSONObject params); static NCMBQuery<NCMBRole> getQuery(); String getRoleName(); void setRoleName(String name); void addUser(List<NCMBUser> users); void addUserInBackground(List<NCMBUser> users, final DoneCallback callback); void removeUser(List<NCMBUser> users); void removeUserInBackground(List<NCMBUser> users, final DoneCallback callback); void addRole(List<NCMBRole> roles); void addRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void removeRole(List<NCMBRole> roles); void removeRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void createRole(); void createRoleInBackground(final DoneCallback callback); void fetchObject(); void fetchObjectInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback);  }
@Test public void fetchObject() throws Exception { NCMBRole role = new NCMBRole("testRole"); role.setObjectId("dummyRoleId"); try { role.fetchObject(); } catch (NCMBException e) { Assert.fail(e.getMessage()); } Assert.assertEquals("role_test1", role.getRoleName()); SimpleDateFormat df = NCMBDateFormat.getIso8601(); Assert.assertEquals(df.parse("2013-08-30T05:04:19.045Z"), role.getCreateDate()); Assert.assertEquals(df.parse("2013-08-30T05:04:19.045Z"), role.getCreateDate()); }