Search in sources :

Example 16 with UserQuery

use of org.activiti.engine.identity.UserQuery in project Activiti by Activiti.

the class UserQueryTest method testQueryByFirstName.

public void testQueryByFirstName() {
    UserQuery query = identityService.createUserQuery().userFirstName("Gonzo");
    verifyQueryResults(query, 1);
    User result = query.singleResult();
    assertEquals("gonzo", result.getId());
}
Also used : User(org.activiti.engine.identity.User) UserQuery(org.activiti.engine.identity.UserQuery)

Example 17 with UserQuery

use of org.activiti.engine.identity.UserQuery in project Activiti by Activiti.

the class UserQueryTest method testQueryById.

public void testQueryById() {
    UserQuery query = identityService.createUserQuery().userId("kermit");
    verifyQueryResults(query, 1);
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 18 with UserQuery

use of org.activiti.engine.identity.UserQuery in project Activiti by Activiti.

the class UserQueryTest method testQueryByNoCriteria.

public void testQueryByNoCriteria() {
    UserQuery query = identityService.createUserQuery();
    verifyQueryResults(query, 3);
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 19 with UserQuery

use of org.activiti.engine.identity.UserQuery in project Activiti by Activiti.

the class UserQueryTest method testQueryByInvalidEmail.

public void testQueryByInvalidEmail() {
    UserQuery query = identityService.createUserQuery().userEmail("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createUserQuery().userEmail(null).singleResult();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) UserQuery(org.activiti.engine.identity.UserQuery)

Example 20 with UserQuery

use of org.activiti.engine.identity.UserQuery in project Activiti by Activiti.

the class UserQueryTest method testQueryByFirstNameLike.

public void testQueryByFirstNameLike() {
    UserQuery query = identityService.createUserQuery().userFirstNameLike("%o%");
    verifyQueryResults(query, 2);
    query = identityService.createUserQuery().userFirstNameLike("Ker%");
    verifyQueryResults(query, 1);
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Aggregations

UserQuery (org.activiti.engine.identity.UserQuery)24 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)8 User (org.activiti.engine.identity.User)5 Item (com.vaadin.data.Item)1 PropertysetItem (com.vaadin.data.util.PropertysetItem)1 ArrayList (java.util.ArrayList)1