Search in sources :

Example 26 with UserQuery

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

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

Example 27 with UserQuery

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

the class UserQueryTest method testQueryByFirstNameLike.

public void testQueryByFirstNameLike() {
    UserQuery query = identityService.createUserQuery().userFirstNameLike("%o%");
    verifyQueryResults(query, 2);
    query = identityService.createUserQuery().userFirstNameLike("Ker%");
    verifyQueryResults(query, 1);
    identityService.createUserQuery().userFirstNameLike("%mit\\_");
    verifyQueryResults(query, 1);
}
Also used : UserQuery(org.camunda.bpm.engine.identity.UserQuery)

Example 28 with UserQuery

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

the class UserQueryTest method testQueryByLastNameLike.

public void testQueryByLastNameLike() {
    UserQuery query = identityService.createUserQuery().userLastNameLike("%\\_frog%");
    verifyQueryResults(query, 1);
    query = identityService.createUserQuery().userLastNameLike("%ea%");
    verifyQueryResults(query, 2);
}
Also used : UserQuery(org.camunda.bpm.engine.identity.UserQuery)

Example 29 with UserQuery

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

the class UserQueryTest method testQueryByInvalidId.

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

Example 30 with UserQuery

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

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

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