Search in sources :

Example 21 with UserQuery

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

the class UserQueryTest method testQueryByInvalidLastNameLike.

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

Example 22 with UserQuery

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

the class UserQueryEscapeClauseTest method testQueryByFullNameLike.

public void testQueryByFullNameLike() {
    UserQuery query = identityService.createUserQuery().userFullNameLike("%og\\%%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("kermit", query.singleResult().getId());
    query = identityService.createUserQuery().userFullNameLike("%it\\%%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("kermit", query.singleResult().getId());
    query = identityService.createUserQuery().userFullNameLike("%ar\\_%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("fozzie", query.singleResult().getId());
    query = identityService.createUserQuery().userFullNameLike("%ie\\_%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("fozzie", query.singleResult().getId());
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 23 with UserQuery

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

the class UserQueryEscapeClauseTest method testQueryByEmailLike.

public void testQueryByEmailLike() {
    UserQuery query = identityService.createUserQuery().userEmailLike("%\\%%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("kermit", query.singleResult().getId());
    query = identityService.createUserQuery().userEmailLike("%\\_%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("fozzie", query.singleResult().getId());
}
Also used : UserQuery(org.activiti.engine.identity.UserQuery)

Example 24 with UserQuery

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

the class UserQueryEscapeClauseTest method testQueryByFirstNameLike.

public void testQueryByFirstNameLike() {
    UserQuery query = identityService.createUserQuery().userFirstNameLike("%\\%%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("kermit", query.singleResult().getId());
    query = identityService.createUserQuery().userFirstNameLike("%\\_%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("fozzie", query.singleResult().getId());
}
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