Search in sources :

Example 41 with CaseDefinitionQuery

use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByLatest.

public void testQueryByLatest() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.latestVersion();
    verifyQueryResults(query, 3);
    query.caseDefinitionKey("one").latestVersion();
    verifyQueryResults(query, 1);
    query.caseDefinitionKey("two").latestVersion();
    verifyQueryResults(query, 1);
}
Also used : CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 42 with CaseDefinitionQuery

use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByCategoryLike.

public void testQueryByCategoryLike() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionCategoryLike("%Example%");
    verifyQueryResults(query, 3);
    query.caseDefinitionCategoryLike("%amples2");
    verifyQueryResults(query, 1);
    query.caseDefinitionCategoryLike("%z\\_");
    verifyQueryResults(query, 1);
}
Also used : CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 43 with CaseDefinitionQuery

use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testInvalidUsageOfLatest.

public void testInvalidUsageOfLatest() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    try {
        query.caseDefinitionId("test").latestVersion().list();
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
    try {
        query.caseDefinitionName("test").latestVersion().list();
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
    try {
        query.caseDefinitionNameLike("test").latestVersion().list();
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
    try {
        query.caseDefinitionVersion(1).latestVersion().list();
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
    try {
        query.deploymentId("test").latestVersion().list();
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 44 with CaseDefinitionQuery

use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByResourceNameLike.

public void testQueryByResourceNameLike() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionResourceNameLike("%ree%");
    verifyQueryResults(query, 1);
    query.caseDefinitionResourceNameLike("%e\\_%");
    verifyQueryResults(query, 1);
}
Also used : CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 45 with CaseDefinitionQuery

use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByKeyLike.

public void testQueryByKeyLike() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionKeyLike("%o%");
    verifyQueryResults(query, 3);
    query.caseDefinitionKeyLike("%z\\_");
    verifyQueryResults(query, 1);
}
Also used : CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Aggregations

CaseDefinitionQuery (org.camunda.bpm.engine.repository.CaseDefinitionQuery)47 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)12 NotValidException (org.camunda.bpm.engine.exception.NotValidException)10 Response (com.jayway.restassured.response.Response)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 User (org.camunda.bpm.engine.identity.User)2 UserQuery (org.camunda.bpm.engine.identity.UserQuery)2 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)2 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)2 CaseDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionQueryDto)2 Deployment (org.camunda.bpm.engine.test.Deployment)2 Test (org.junit.Test)2 Matchers.anyString (org.mockito.Matchers.anyString)2 InputStream (java.io.InputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 ProcessApplicationService (org.camunda.bpm.ProcessApplicationService)1 ProcessApplicationInfo (org.camunda.bpm.application.ProcessApplicationInfo)1