Search in sources :

Example 11 with DecisionDefinitionQuery

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

the class DecisionDefinitionAuthorizationTest method testQueryWithoutAuthorization.

public void testQueryWithoutAuthorization() {
    // given user is not authorized to read any decision definition
    // when
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    // then
    verifyQueryResults(query, 0);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery)

Example 12 with DecisionDefinitionQuery

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

the class DecisionDefinitionQueryTest method queryByInvalidKey.

@Test
public void queryByInvalidKey() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionKey("invalid");
    verifyQueryResults(query, 0);
    try {
        query.decisionDefinitionKey(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 13 with DecisionDefinitionQuery

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

the class DecisionDefinitionQueryTest method queryByKeyLike.

@Test
public void queryByKeyLike() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionKeyLike("%o%");
    verifyQueryResults(query, 3);
    query.decisionDefinitionKeyLike("%z\\_");
    verifyQueryResults(query, 1);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 14 with DecisionDefinitionQuery

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

the class DecisionDefinitionQueryTest method queryByInvalidNResourceNameLike.

@Test
public void queryByInvalidNResourceNameLike() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionResourceNameLike("%invalid%");
    verifyQueryResults(query, 0);
    try {
        query.decisionDefinitionNameLike(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 15 with DecisionDefinitionQuery

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

the class DecisionDefinitionQueryTest method queryByDecisionRequirementsDefinitionKey.

@Test
public void queryByDecisionRequirementsDefinitionKey() {
    testRule.deploy(DRD_DISH_RESOURCE, DRD_SCORE_RESOURCE);
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    verifyQueryResults(query.decisionRequirementsDefinitionKey("non existing"), 0);
    verifyQueryResults(query.decisionRequirementsDefinitionKey("dish"), 3);
    verifyQueryResults(query.decisionRequirementsDefinitionKey("score"), 2);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Aggregations

DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)49 Test (org.junit.Test)23 NotValidException (org.camunda.bpm.engine.exception.NotValidException)10 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)10 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 DecisionDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto)2 Deployment (org.camunda.bpm.engine.test.Deployment)2 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 DecisionDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto)1