EasemobIMUsers { public static ObjectNode createNewIMUserSingle(ObjectNode dataNode) { ObjectNode objectNode = factory.objectNode(); if (!JerseyUtils.match("^(?!-)[0-9a-zA-Z\\-]+#[0-9a-zA-Z]+", APPKEY)) { LOGGER.error("Bad format of Appkey: " + APPKEY); objectNode.put("message", "Bad format of Appkey"); return objectNode; } objectNode.removeAll(); if (null != dataNode && !dataNode.has("username")) { LOGGER.error("Property that named username must be provided ."); objectNode.put("message", "Property that named username must be provided ."); return objectNode; } if (null != dataNode && !dataNode.has("password")) { LOGGER.error("Property that named password must be provided ."); objectNode.put("message", "Property that named password must be provided ."); return objectNode; } try { JerseyWebTarget webTarget = null; webTarget = EndPoints.USERS_TARGET.resolveTemplate("org_name", APPKEY.split("#")[0]).resolveTemplate("app_name", APPKEY.split("#")[1]); objectNode = JerseyUtils.sendRequest(webTarget, dataNode, credential, HTTPMethod.METHOD_POST, null); } catch (Exception e) { e.printStackTrace(); } return objectNode; }  static ObjectNode createNewIMUserSingle(ObjectNode dataNode); static ObjectNode createNewIMUserBatch(ArrayNode dataArrayNode); static ObjectNode createNewIMUserBatchGen(String usernamePrefix,
			Long perNumber, Long totalNumber); static ObjectNode getIMUsersByPrimaryKey(String userPrimaryKey); static ObjectNode deleteIMUserByUserPrimaryKey(String userPrimaryKey); static ObjectNode deleteIMUserByUsernameBatch(Long limit,
			String queryStr); static ObjectNode modifyIMUserPasswordWithAdminToken(
			String userPrimaryKey, ObjectNode dataObjectNode); static ObjectNode addFriendSingle(String ownerUserPrimaryKey,
			String friendUserPrimaryKey); static ObjectNode deleteFriendSingle(String ownerUserPrimaryKey,
			String friendUserPrimaryKey); static ObjectNode getFriends(String ownerUserPrimaryKey); static ObjectNode imUserLogin(String ownerUserPrimaryKey, String password);  }
@Test public void testCreateNewIMUserSingle() throws Exception { ObjectNode datanode = JsonNodeFactory.instance.objectNode(); datanode.put("username","101"); datanode.put("password", Constants.DEFAULT_PASSWORD); ObjectNode createNewIMUserSingleNode = EasemobIMUsers.createNewIMUserSingle(datanode); if (null != createNewIMUserSingleNode) { LOGGER.info("注册IM用户[单个]: " + createNewIMUserSingleNode.toString()); } }