Search in sources :

Example 81 with NotValidException

use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByInvalidKey.

public void testQueryByInvalidKey() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionKey("invalid");
    verifyQueryResults(query, 0);
    try {
        query.caseDefinitionKey(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 82 with NotValidException

use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByInvalidResourceNameLike.

public void testQueryByInvalidResourceNameLike() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionResourceNameLike("%invalid%");
    verifyQueryResults(query, 0);
    try {
        query.caseDefinitionNameLike(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 83 with NotValidException

use of org.camunda.bpm.engine.exception.NotValidException 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 84 with NotValidException

use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.

the class CaseDefinitionQueryTest method testQueryByInvalidName.

public void testQueryByInvalidName() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
    query.caseDefinitionName("invalid");
    verifyQueryResults(query, 0);
    try {
        query.caseDefinitionName(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Example 85 with NotValidException

use of org.camunda.bpm.engine.exception.NotValidException in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByInvalidCategory.

@Test
public void queryByInvalidCategory() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionCategory("invalid");
    verifyQueryResults(query, 0);
    try {
        query.decisionDefinitionCategory(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)

Aggregations

NotValidException (org.camunda.bpm.engine.exception.NotValidException)121 Test (org.junit.Test)28 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)24 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)24 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)18 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)17 Deployment (org.camunda.bpm.engine.test.Deployment)12 CaseDefinitionQuery (org.camunda.bpm.engine.repository.CaseDefinitionQuery)10 DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)10 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)10 CaseService (org.camunda.bpm.engine.CaseService)9 NotAllowedException (org.camunda.bpm.engine.exception.NotAllowedException)9 RestException (org.camunda.bpm.engine.rest.exception.RestException)8 CaseExecutionCommandBuilder (org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder)8 CaseInstanceQuery (org.camunda.bpm.engine.runtime.CaseInstanceQuery)8 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)6 HashMap (java.util.HashMap)5 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)4 InputStream (java.io.InputStream)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3