use of org.camunda.bpm.engine.exception.NullValueException in project camunda-bpm-platform by camunda.
the class JobRestServiceInteractionTest method deleteNotExistingJob.
@Test
public void deleteNotExistingJob() {
String jobId = MockProvider.NON_EXISTING_JOB_ID;
String expectedMessage = "No job found with id '" + jobId + "'.";
doThrow(new NullValueException(expectedMessage)).when(mockManagementService).deleteJob(jobId);
given().pathParam("id", jobId).then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).body("type", equalTo(InvalidRequestException.class.getSimpleName())).body("message", equalTo(expectedMessage)).when().delete(SINGLE_JOB_RESOURCE_URL);
verify(mockManagementService).deleteJob(jobId);
verifyNoMoreInteractions(mockManagementService);
}
use of org.camunda.bpm.engine.exception.NullValueException in project camunda-bpm-platform by camunda.
the class ProcessInstanceQueryTest method testQueryByInvalidSuperCaseInstanceId.
@Test
public void testQueryByInvalidSuperCaseInstanceId() {
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();
assertNull(query.superProcessInstanceId("invalid").singleResult());
assertEquals(0, query.superProcessInstanceId("invalid").list().size());
try {
query.superCaseInstanceId(null);
fail();
} catch (NullValueException e) {
// expected
}
}
use of org.camunda.bpm.engine.exception.NullValueException in project camunda-bpm-platform by camunda.
the class ProcessInstanceQueryTest method testQueryByInvalidSubCaseInstanceId.
@Test
public void testQueryByInvalidSubCaseInstanceId() {
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();
assertNull(query.subProcessInstanceId("invalid").singleResult());
assertEquals(0, query.subProcessInstanceId("invalid").list().size());
try {
query.subCaseInstanceId(null);
fail();
} catch (NullValueException e) {
// expected
}
}
use of org.camunda.bpm.engine.exception.NullValueException in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testGetInvalidTransitionInstancesForActivity.
@Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testGetTransitionInstancesForActivity.bpmn20.xml")
@Test
public void testGetInvalidTransitionInstancesForActivity() {
ProcessInstance instance = runtimeService.startProcessInstanceByKey("miSubprocess");
ActivityInstance tree = runtimeService.getActivityInstance(instance.getId());
try {
tree.getTransitionInstances(null);
fail("exception expected");
} catch (NullValueException e) {
// happy path
}
}
use of org.camunda.bpm.engine.exception.NullValueException in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceStatisticsQueryTest method testStatisticForRootDecisionWithNullInstanceConstraintEvaluation.
@Test
public void testStatisticForRootDecisionWithNullInstanceConstraintEvaluation() throws Exception {
// when
decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue(TEMPERATURE, 21).putValue(DAY_TYPE, WEEKEND)).evaluate();
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();
// when
HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.getId()).decisionInstanceId(null);
// then
try {
query.count();
} catch (NullValueException e) {
// expected
}
try {
query.list();
} catch (NullValueException e) {
// expected
}
}
Aggregations