Search in sources :

Example 11 with UserQuery

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

the class UserQueryTest method testQueryByEmailLike.

public void testQueryByEmailLike() {
    UserQuery query = identityService.createUserQuery().userEmailLike("%muppetshow.com");
    verifyQueryResults(query, 3);
    query = identityService.createUserQuery().userEmailLike("%kermit%");
    verifyQueryResults(query, 1);
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 12 with UserQuery

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

the class UserQueryTest method testQueryByLastNameLike.

public void testQueryByLastNameLike() {
    UserQuery query = identityService.createUserQuery().userLastNameLike("%rog%");
    verifyQueryResults(query, 1);
    query = identityService.createUserQuery().userLastNameLike("%ea%");
    verifyQueryResults(query, 2);
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 13 with UserQuery

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

the class UserQueryTest method testQueryByInvalidId.

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

Example 14 with UserQuery

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

the class UserQueryTest method testQueryByLastName.

public void testQueryByLastName() {
    UserQuery query = identityService.createUserQuery().userLastName("Bear");
    verifyQueryResults(query, 1);
    User result = query.singleResult();
    assertEquals("fozzie", result.getId());
}
Also used : User(org.activiti.engine.identity.User) UserQuery(org.activiti.engine.identity.UserQuery)

Example 15 with UserQuery

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

the class UserQueryTest method testQueryByEmail.

public void testQueryByEmail() {
    UserQuery query = identityService.createUserQuery().userEmail("kermit@muppetshow.com");
    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