Search in sources :

Example 1 with GroupQuery

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

the class GroupQueryTest method testQueryByInvalidName.

public void testQueryByInvalidName() {
    GroupQuery query = identityService.createGroupQuery().groupName("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createGroupQuery().groupName(null).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 2 with GroupQuery

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

the class GroupQueryTest method testQueryByInvalidId.

public void testQueryByInvalidId() {
    GroupQuery query = identityService.createGroupQuery().groupId("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createGroupQuery().groupId(null).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 3 with GroupQuery

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

the class GroupQueryTest method testQueryByMember.

public void testQueryByMember() {
    GroupQuery query = identityService.createGroupQuery().groupMember("fozzie");
    verifyQueryResults(query, 2);
    query = identityService.createGroupQuery().groupMember("kermit");
    verifyQueryResults(query, 3);
    query = query.orderByGroupId().asc();
    List<Group> groups = query.list();
    assertEquals(3, groups.size());
    assertEquals("admin", groups.get(0).getId());
    assertEquals("frogs", groups.get(1).getId());
    assertEquals("muppets", groups.get(2).getId());
    query = query.groupType("user");
    groups = query.list();
    assertEquals(2, groups.size());
    assertEquals("frogs", groups.get(0).getId());
    assertEquals("muppets", groups.get(1).getId());
}
Also used : Group(org.activiti.engine.identity.Group) GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 4 with GroupQuery

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

the class GroupQueryTest method testQueryByName.

public void testQueryByName() {
    GroupQuery query = identityService.createGroupQuery().groupName("Muppet show characters");
    verifyQueryResults(query, 1);
    query = identityService.createGroupQuery().groupName("Famous frogs");
    verifyQueryResults(query, 1);
}
Also used : GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 5 with GroupQuery

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

the class GroupQueryTest method testQueryByNameLike.

public void testQueryByNameLike() {
    GroupQuery query = identityService.createGroupQuery().groupNameLike("%Famous%");
    verifyQueryResults(query, 2);
    query = identityService.createGroupQuery().groupNameLike("Famous%");
    verifyQueryResults(query, 2);
    query = identityService.createGroupQuery().groupNameLike("%show%");
    verifyQueryResults(query, 1);
}
Also used : GroupQuery(org.activiti.engine.identity.GroupQuery)

Aggregations

GroupQuery (org.activiti.engine.identity.GroupQuery)12 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)5 Group (org.activiti.engine.identity.Group)2