Search in sources :

Example 6 with User

use of org.jboss.as.quickstarts.tasksrs.model.User in project quickstart by wildfly.

the class TaskResource method getUser.

private User getUser(String username) {
    try {
        User user = userDao.getForUsername(username);
        if (user == null) {
            user = new User(username);
            userDao.createUser(user);
        }
        return user;
    } catch (Exception e) {
        throw new WebApplicationException(e);
    }
}
Also used : User(org.jboss.as.quickstarts.tasksrs.model.User) WebApplicationException(javax.ws.rs.WebApplicationException) WebApplicationException(javax.ws.rs.WebApplicationException)

Example 7 with User

use of org.jboss.as.quickstarts.tasksrs.model.User in project quickstart by wildfly.

the class TaskDaoIT method setUp.

@Before
public void setUp() throws Exception {
    detachedUser = new User("jdoe");
    detachedUser.setId(1L);
}
Also used : User(org.jboss.as.quickstarts.tasksrs.model.User) Before(org.junit.Before)

Aggregations

User (org.jboss.as.quickstarts.tasksrs.model.User)7 Test (org.junit.Test)4 Task (org.jboss.as.quickstarts.tasksrs.model.Task)2 URI (java.net.URI)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 UriBuilder (javax.ws.rs.core.UriBuilder)1 InSequence (org.jboss.arquillian.junit.InSequence)1 Before (org.junit.Before)1