EasemobChatGroups { public static ObjectNode getJoinedChatgroupsForIMUser(String username) { 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; } if (StringUtils.isBlank(username.trim())) { LOGGER.error("Property that named username must be provided ."); objectNode.put("message", "Property that named username must be provided ."); return objectNode; } try { objectNode = JerseyUtils.sendRequest(EndPoints.USERS_TARGET.path(username).path("joined_chatgroups"), null, credential, HTTPMethod.METHOD_GET, null); } catch (Exception e) { e.printStackTrace(); } return objectNode; }  static ObjectNode getAllChatgroupids(); static ObjectNode getGroupDetailsByChatgroupid(String[] chatgroupIDs); static ObjectNode createChatGroups(ObjectNode dataObjectNode); static ObjectNode deleteChatGroups(String chatgroupid); static ObjectNode getAllMemberssByGroupId(String chatgroupid); static ObjectNode addUserToGroup(String chatgroupid, String userprimarykey); static ObjectNode deleteUserFromGroup(String chatgroupid, String userprimarykey); static ObjectNode getJoinedChatgroupsForIMUser(String username); static ObjectNode addUsersToGroupBatch(String toAddBacthChatgroupid, ObjectNode usernames);  }
@Test public void testGetJoinedChatgroupsForIMUser() throws Exception { String username = "xiaojianguo002"; ObjectNode getJoinedChatgroupsForIMUserNode = EasemobChatGroups.getJoinedChatgroupsForIMUser(username); System.out.println(getJoinedChatgroupsForIMUserNode.toString()); }