Search in sources :

Example 36 with ServiceResult

use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.

the class AbstractWebServiceTest method webCreateUser.

public void webCreateUser(User u) {
    ServiceResult r = login();
    UserDTO dto = new UserDTO(u);
    dto.setPassword(createPass());
    UserDTO user = getClient(getUserUrl()).path("/").query("sid", r.getMessage()).type(APPLICATION_FORM_URLENCODED).post(new Form().param("user", dto.toString()).param("confirm", "" + false), UserDTO.class);
    Assert.assertNotNull(user.getId());
    u.setId(user.getId());
}
Also used : ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult) Form(javax.ws.rs.core.Form) UserDTO(org.apache.openmeetings.db.dto.user.UserDTO)

Example 37 with ServiceResult

use of org.apache.openmeetings.db.dto.basic.ServiceResult in project openmeetings by apache.

the class AbstractWebServiceTest method login.

public static ServiceResult login(String user, String pass) {
    ServiceResult sr = loginNoCheck(user, pass);
    assertEquals("Login should be successful", Type.SUCCESS.name(), sr.getType());
    return sr;
}
Also used : ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult)

Aggregations

ServiceResult (org.apache.openmeetings.db.dto.basic.ServiceResult)37 Test (org.junit.Test)18 Path (javax.ws.rs.Path)12 User (org.apache.openmeetings.db.entity.user.User)8 Response (javax.ws.rs.core.Response)7 WebMethod (javax.jws.WebMethod)5 POST (javax.ws.rs.POST)5 Room (org.apache.openmeetings.db.entity.room.Room)5 GroupUser (org.apache.openmeetings.db.entity.user.GroupUser)5 DELETE (javax.ws.rs.DELETE)4 Form (javax.ws.rs.core.Form)4 AbstractJUnitDefaults.getUser (org.apache.openmeetings.AbstractJUnitDefaults.getUser)4 GET (javax.ws.rs.GET)3 AbstractJUnitDefaults.createUser (org.apache.openmeetings.AbstractJUnitDefaults.createUser)3 GroupDao (org.apache.openmeetings.db.dao.user.GroupDao)3 RoomDTO (org.apache.openmeetings.db.dto.room.RoomDTO)3 Locale (java.util.Locale)2 AppointmentDTO (org.apache.openmeetings.db.dto.calendar.AppointmentDTO)2 UserDTO (org.apache.openmeetings.db.dto.user.UserDTO)2 FileItem (org.apache.openmeetings.db.entity.file.FileItem)2