Search in sources :

Example 1 with UserQuery

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

the class UserQueryTest method testQueryByInvalidEmailLike.

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

Example 2 with UserQuery

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

the class UserQueryTest method testQueryByInvalidFirstNameLike.

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

Example 3 with UserQuery

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

the class UserQueryTest method testQueryByMemberOf.

public void testQueryByMemberOf() {
    UserQuery query = identityService.createUserQuery().memberOfGroup("muppets");
    verifyQueryResults(query, 3);
    query = identityService.createUserQuery().memberOfGroup("frogs");
    verifyQueryResults(query, 1);
    User result = query.singleResult();
    assertEquals("kermit", result.getId());
}
Also used : User(org.activiti.engine.identity.User) UserQuery(org.activiti.engine.identity.UserQuery)

Example 4 with UserQuery

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

the class UserQueryTest method testQueryByInvalidMemberOf.

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

Example 5 with UserQuery

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

the class UserQueryTest method testQueryByInvalidFirstName.

public void testQueryByInvalidFirstName() {
    UserQuery query = identityService.createUserQuery().userFirstName("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createUserQuery().userFirstName(null).singleResult();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) 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