use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.
the class UserQueryTest method testQueryByInvalidLastName.
public void testQueryByInvalidLastName() {
UserQuery query = identityService.createUserQuery().userLastName("invalid");
verifyQueryResults(query, 0);
try {
identityService.createUserQuery().userLastName(null).singleResult();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.
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 (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.
the class UserQueryTest method testQueryByMemberOfGroup.
public void testQueryByMemberOfGroup() {
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());
}
use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.
the class UserQueryTest method testQuerySorting.
public void testQuerySorting() {
// asc
assertEquals(3, identityService.createUserQuery().orderByUserId().asc().count());
assertEquals(3, identityService.createUserQuery().orderByUserEmail().asc().count());
assertEquals(3, identityService.createUserQuery().orderByUserFirstName().asc().count());
assertEquals(3, identityService.createUserQuery().orderByUserLastName().asc().count());
// desc
assertEquals(3, identityService.createUserQuery().orderByUserId().desc().count());
assertEquals(3, identityService.createUserQuery().orderByUserEmail().desc().count());
assertEquals(3, identityService.createUserQuery().orderByUserFirstName().desc().count());
assertEquals(3, identityService.createUserQuery().orderByUserLastName().desc().count());
// Combined with criteria
UserQuery query = identityService.createUserQuery().userLastNameLike("%ea%").orderByUserFirstName().asc();
List<User> users = query.list();
assertEquals(2, users.size());
assertEquals("Fozzie", users.get(0).getFirstName());
assertEquals("Gonzo", users.get(1).getFirstName());
}
use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.
the class UserQueryTest method testQueryById.
public void testQueryById() {
UserQuery query = identityService.createUserQuery().userId("kermit");
verifyQueryResults(query, 1);
}
Aggregations