use of org.apache.openmeetings.db.dto.room.RoomOptionsDTO in project openmeetings by apache.
the class TestUserService method getHash.
private static ServiceResult getHash(String sid, boolean expectError) {
ExternalUserDTO user = new ExternalUserDTO().setExternalId("1").setExternalType(UNIT_TEST_EXT_TYPE).setEmail("user1@junit.openmeetings.apache.org").setFirstname("First Name 1").setLastname("Last Name 1").setLogin("login1");
RoomOptionsDTO options = new RoomOptionsDTO().setRoomId(5L).setModerator(true);
try (Response resp = getClient(getUserUrl()).path("/hash").query("sid", sid).form(new Form().param("user", user.toString()).param("options", options.toString()))) {
assertNotNull("Valid ServiceResult should be returned", resp);
if (expectError) {
assertEquals("Call should NOT be successful", Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), resp.getStatus());
return null;
} else {
assertEquals("Call should be successful", Response.Status.OK.getStatusCode(), resp.getStatus());
return resp.readEntity(ServiceResult.class);
}
}
}
Aggregations