Search in sources :

Example 11 with UserQuery

use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.

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 (ProcessEngineException e) {
    }
}
Also used : UserQuery(org.camunda.bpm.engine.identity.UserQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 12 with UserQuery

use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.

the class UserQueryTest method testQueryByInvalidEmail.

public void testQueryByInvalidEmail() {
    UserQuery query = identityService.createUserQuery().userEmail("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createUserQuery().userEmail(null).singleResult();
        fail();
    } catch (ProcessEngineException e) {
    }
}
Also used : UserQuery(org.camunda.bpm.engine.identity.UserQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 13 with UserQuery

use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.

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.camunda.bpm.engine.identity.User) UserQuery(org.camunda.bpm.engine.identity.UserQuery)

Example 14 with UserQuery

use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.

the class UserQueryTest method testQueryByEmail.

public void testQueryByEmail() {
    UserQuery query = identityService.createUserQuery().userEmail("kermit_@muppetshow.com");
    verifyQueryResults(query, 1);
}
Also used : UserQuery(org.camunda.bpm.engine.identity.UserQuery)

Example 15 with UserQuery

use of org.camunda.bpm.engine.identity.UserQuery in project camunda-bpm-platform by camunda.

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.camunda.bpm.engine.identity.UserQuery)

Aggregations

UserQuery (org.camunda.bpm.engine.identity.UserQuery)41 User (org.camunda.bpm.engine.identity.User)24 Test (org.junit.Test)17 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)8 Matchers.anyString (org.mockito.Matchers.anyString)8 UserCredentialsDto (org.camunda.bpm.engine.rest.dto.identity.UserCredentialsDto)5 Group (org.camunda.bpm.engine.identity.Group)4 GroupQuery (org.camunda.bpm.engine.identity.GroupQuery)4 Authentication (org.camunda.bpm.engine.impl.identity.Authentication)4 HashMap (java.util.HashMap)3 UserProfileDto (org.camunda.bpm.engine.rest.dto.identity.UserProfileDto)3 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)3 Response (com.jayway.restassured.response.Response)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 AuthorizationException (org.camunda.bpm.engine.AuthorizationException)2 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)2 CaseDefinitionQuery (org.camunda.bpm.engine.repository.CaseDefinitionQuery)2 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)2 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)2