use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestGroupService method list.
@Test
public void list() {
ServiceResult r = login();
Collection<? extends GroupDTO> groups = getClient(getGroupUrl()).path("/").query("sid", r.getMessage()).getCollection(GroupDTO.class);
assertNotNull("Collection should be not null", groups);
assertFalse("Collection should be not empty", groups.isEmpty());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestGroupService method putTest.
@Test
public void putTest() {
ServiceResult r = login();
Response resp = getClient(getGroupUrl()).path("/").query("sid", r.getMessage()).put("");
assertEquals("Call should NOT be successful", Response.Status.METHOD_NOT_ALLOWED.getStatusCode(), resp.getStatus());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestRoomService method testExternal.
@Test
public void testExternal() {
ServiceResult sr = login();
String extId = UUID.randomUUID().toString();
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room";
String comment = "Unit Test Ext Room Comments";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
RoomDTO room = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", type, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).query("room", r.toString()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room);
assertNotNull("Room ID should be not empty", room.getId());
RoomDTO room1 = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", Room.Type.presentation, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room1);
assertEquals("Same Room should be returned", room.getId(), room1.getId());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestRoomService method testHash.
@Test
public void testHash() {
List<Room> rooms = getBean(RoomDao.class).get(0, 100);
assertFalse("Room list should not be empty", rooms.isEmpty());
ServiceResult sr = login();
ServiceResult res = getClient(getRoomUrl()).path("/hash").query("sid", sr.getMessage()).query("invite", new InvitationDTO().setFirstname("Mark").setLastname("Steven").setEmail("abc@gmail.com").setPassword("Sys@123!").setPasswordProtected(true).setSubject("Health Meeting").setRoomId(rooms.get(0).getId()).setMessage("Meeting").setValid(Valid.Period).setValidFrom("2018-03-19 02:25:12").setValidTo("2018-04-20 02:25:12").toString()).post("", ServiceResult.class);
assertEquals("Login should be successful", Type.SUCCESS.name(), res.getType());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestUserService method addUserTest.
@Test
public void addUserTest() {
String[] tzList = TimeZone.getAvailableIDs();
String tz = TimeZone.getTimeZone(tzList[rnd.nextInt(tzList.length)]).getID();
ServiceResult r = login();
UserDTO u = new UserDTO();
String uuid = UUID.randomUUID().toString();
u.setLogin("test" + uuid);
u.setPassword(createPass());
u.setFirstname("testF" + uuid);
u.setLastname("testL" + uuid);
u.setAddress(new Address());
u.getAddress().setEmail(uuid + "@local");
u.getAddress().setCountry(Locale.getDefault().getCountry());
u.setTimeZoneId(tz);
u.setExternalId(uuid);
u.setExternalType(UNIT_TEST_EXT_TYPE);
UserDTO user = getClient(getUserUrl()).path("/").query("sid", r.getMessage()).type(APPLICATION_FORM_URLENCODED).post(new Form().param("user", u.toString()).param("confirm", "" + false), UserDTO.class);
assertNotNull("Valid UserDTO should be returned", user);
assertNotNull("Id should not be NULL", user.getId());
assertEquals("OM Call should be successful", u.getLogin(), user.getLogin());
assertEquals("OM Call should be successful", tz, user.getTimeZoneId());
}
Aggregations