use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestUserService method loginTest.
@Test
public void loginTest() {
ServiceResult r = login();
assertNotNull("Valid ServiceResult should be returned", r);
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestUserService method list.
@Test
public void list() {
ServiceResult r = login();
Collection<? extends UserDTO> users = getClient(getUserUrl()).path("/").query("sid", r.getMessage()).getCollection(UserDTO.class);
assertNotNull("Collection should be not null", users);
assertFalse("Collection should be not empty", users.isEmpty());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestCalendarService method testDelete.
@Test
public void testDelete() {
ServiceResult sr = login();
Response resp = getClient(getCalendarUrl()).path(// non-existent ID
"/" + Long.MAX_VALUE).query("sid", sr.getMessage()).delete();
assertNotEquals("Call should NOT be successful", Response.Status.OK.getStatusCode(), resp.getStatus());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestErrorService method reportTest.
@Test
public void reportTest() {
// null report
Response resp = getClient(getErrorUrl()).path("/report").post("");
assertNotNull("Not null Response should be returned", resp);
assertEquals("SUCCESS result should be returned", Response.Status.NO_CONTENT.getStatusCode(), resp.getStatus());
// report with message
resp = getClient(getErrorUrl()).path("/report").query("message", "Dummy test").post("");
assertNotNull("Not null Response should be returned", resp);
assertEquals("SUCCESS result should be returned", Response.Status.NO_CONTENT.getStatusCode(), resp.getStatus());
// report with invalid sid and message
resp = getClient(getErrorUrl()).path("/report").query("message", "Dummy test").query("sid", "n/a").post("");
assertNotNull("Not null Response should be returned", resp);
assertEquals("SUCCESS result should be returned", Response.Status.NO_CONTENT.getStatusCode(), resp.getStatus());
// report with valid sid and no message
ServiceResult r = login();
resp = getClient(getErrorUrl()).path("/report").query("sid", r.getMessage()).post("");
assertNotNull("Not null Response should be returned", resp);
assertEquals("SUCCESS result should be returned", Response.Status.NO_CONTENT.getStatusCode(), resp.getStatus());
// report with valid sid and message
resp = getClient(getErrorUrl()).path("/report").query("sid", r.getMessage()).query("message", "Dummy test").post("");
assertNotNull("Not null Response should be returned", resp);
assertEquals("SUCCESS result should be returned", Response.Status.NO_CONTENT.getStatusCode(), resp.getStatus());
}
use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.
the class TestErrorService method getTest.
@Test
public void getTest() {
Locale[] locales = Locale.getAvailableLocales();
ServiceResult sr = getClient(getErrorUrl()).path(String.format("/%s/%s", "error.unknown", LabelDao.getLanguage(locales[rnd.nextInt(locales.length)], 1L))).get(ServiceResult.class);
assertNotNull("Valid Result should be returned", sr);
assertEquals("SUCCESS result should be returned", ServiceResult.Type.SUCCESS.name(), sr.getType());
}
Aggregations