As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
/** * Detailed test of get Parents */ public void testGetParents() throws Exception { createTestTree(); /** * Get all parents for the root group ALFRESCO_ADMINISTRATORS groups which has no parents */ { Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + ADMIN_GROUP + "/parents"), Status.STATUS_OK); JSONObject top = new JSONObject(response.getContentAsString()); logger.debug(response.getContentAsString()); JSONArray data = top.getJSONArray("data"); // Top level group has no parents assertTrue("top level group has no parents", data.length() == 0); } /** * Get GROUP B Which should be a child of TESTROOT */ { Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + TEST_GROUPB + "/parents"), Status.STATUS_OK); JSONObject top = new JSONObject(response.getContentAsString()); logger.debug(response.getContentAsString()); JSONArray data = top.getJSONArray("data"); assertTrue(data.length() > 0); } /** * Get GROUP D Which should be a child of GROUPB child of TESTROOT */ { Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + TEST_GROUPD + "/parents?level=ALL"), Status.STATUS_OK); JSONObject top = new JSONObject(response.getContentAsString()); logger.debug(response.getContentAsString()); JSONArray data = top.getJSONArray("data"); assertTrue(data.length() >= 2); }