use of org.olat.restapi.support.vo.GroupVOes in project OpenOLAT by OpenOLAT.
the class UserMgmtTest method testUserGroupWithPaging.
@Test
public void testUserGroupWithPaging() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
// retrieve all groups
URI uri = UriBuilder.fromUri(getContextURI()).path("users").path(id1.getKey().toString()).path("groups").queryParam("start", 0).queryParam("limit", 1).build();
HttpGet method = conn.createGet(uri, MediaType.APPLICATION_JSON + ";pagingspec=1.0", true);
HttpResponse response = conn.execute(method);
assertEquals(200, response.getStatusLine().getStatusCode());
GroupVOes groups = conn.parse(response, GroupVOes.class);
assertNotNull(groups);
assertNotNull(groups.getGroups());
assertEquals(1, groups.getGroups().length);
// g1, g2 and g3
assertEquals(3, groups.getTotalCount());
conn.shutdown();
}
use of org.olat.restapi.support.vo.GroupVOes in project OpenOLAT by OpenOLAT.
the class UserMgmtTest method testUserGroup_participant.
@Test
public void testUserGroup_participant() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
// retrieve all groups
URI uri = UriBuilder.fromUri(getContextURI()).path("users").path(id1.getKey().toString()).path("groups").path("participant").queryParam("start", 0).queryParam("limit", 1).build();
HttpGet method = conn.createGet(uri, MediaType.APPLICATION_JSON + ";pagingspec=1.0", true);
HttpResponse response = conn.execute(method);
assertEquals(200, response.getStatusLine().getStatusCode());
GroupVOes groups = conn.parse(response, GroupVOes.class);
assertNotNull(groups);
assertNotNull(groups.getGroups());
assertEquals(1, groups.getGroups().length);
// g2 and g3
assertEquals(2, groups.getTotalCount());
conn.shutdown();
}
use of org.olat.restapi.support.vo.GroupVOes in project openolat by klemens.
the class UserMgmtTest method testUserGroupWithPaging.
@Test
public void testUserGroupWithPaging() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
// retrieve all groups
URI uri = UriBuilder.fromUri(getContextURI()).path("users").path(id1.getKey().toString()).path("groups").queryParam("start", 0).queryParam("limit", 1).build();
HttpGet method = conn.createGet(uri, MediaType.APPLICATION_JSON + ";pagingspec=1.0", true);
HttpResponse response = conn.execute(method);
assertEquals(200, response.getStatusLine().getStatusCode());
GroupVOes groups = conn.parse(response, GroupVOes.class);
assertNotNull(groups);
assertNotNull(groups.getGroups());
assertEquals(1, groups.getGroups().length);
// g1, g2 and g3
assertEquals(3, groups.getTotalCount());
conn.shutdown();
}
Aggregations