use of org.camunda.bpm.engine.BadUserRequestException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMigrateNonExistingSourceDefinition.
@Test
public void testMigrateNonExistingSourceDefinition() {
ProcessDefinition processDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
try {
runtimeService.createMigrationPlan("aNonExistingProcDefId", processDefinition.getId()).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (BadUserRequestException e) {
assertExceptionMessage(e, "Source process definition with id 'aNonExistingProcDefId' does not exist");
}
}
use of org.camunda.bpm.engine.BadUserRequestException in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionEvaluationTest method testFailToEvaluateDecisionByIdWithTenantId.
public void testFailToEvaluateDecisionByIdWithTenantId() {
deploymentForTenant(TENANT_ONE, DMN_FILE);
DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
try {
decisionService.evaluateDecisionById(decisionDefinition.getId()).variables(createVariables()).decisionDefinitionTenantId(TENANT_ONE).evaluate();
fail("BadUserRequestException exception");
} catch (BadUserRequestException e) {
assertThat(e.getMessage(), containsString("Cannot specify a tenant-id"));
}
}
use of org.camunda.bpm.engine.BadUserRequestException in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionEvaluationTest method testFailToEvaluateDecisionByIdWithoutTenantId.
public void testFailToEvaluateDecisionByIdWithoutTenantId() {
deployment(DMN_FILE);
DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
try {
decisionService.evaluateDecisionById(decisionDefinition.getId()).variables(createVariables()).decisionDefinitionWithoutTenantId().evaluate();
fail("BadUserRequestException exception");
} catch (BadUserRequestException e) {
assertThat(e.getMessage(), containsString("Cannot specify a tenant-id"));
}
}
use of org.camunda.bpm.engine.BadUserRequestException in project camunda-bpm-platform by camunda.
the class CreateAndResolveIncidentTest method resolveIncidentOfTypeFailedJob.
@Test
public void resolveIncidentOfTypeFailedJob() {
// given
testRule.deploy("org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldCreateOneIncident.bpmn");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
// when
List<Job> jobs = engineRule.getManagementService().createJobQuery().withRetriesLeft().list();
for (Job job : jobs) {
engineRule.getManagementService().setJobRetries(job.getId(), 1);
try {
engineRule.getManagementService().executeJob(job.getId());
} catch (Exception e) {
}
}
// then
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();
try {
runtimeService.resolveIncident(incident.getId());
fail("Exception expected");
} catch (BadUserRequestException e) {
assertThat(e.getMessage(), containsString("Cannot resolve an incident of type failedJob"));
}
}
use of org.camunda.bpm.engine.BadUserRequestException in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testDecisionDefinitionUpdateTimeToLiveNegative.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/dmn/Example.dmn" })
public void testDecisionDefinitionUpdateTimeToLiveNegative() {
// given
DecisionDefinition decisionDefinition = findOnlyDecisionDefinition();
// when
try {
repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinition.getId(), -1);
fail("Exception is expected, that negative value is not allowed.");
} catch (BadUserRequestException ex) {
assertTrue(ex.getMessage().contains("greater than"));
}
}
Aggregations