use of org.camunda.bpm.engine.exception.NotFoundException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testGetDeployedTaskFormWithUnexistingForm.
@Test
public void testGetDeployedTaskFormWithUnexistingForm() {
String message = "not found";
when(formServiceMock.getDeployedTaskForm(anyString())).thenThrow(new NotFoundException(message));
given().pathParam("id", MockProvider.EXAMPLE_TASK_ID).then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).body("message", equalTo(message)).when().get(DEPLOYED_TASK_FORM_URL);
}
use of org.camunda.bpm.engine.exception.NotFoundException in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testEvaluateDecision_NotFound.
@Test
public void testEvaluateDecision_NotFound() {
String message = "expected message";
when(decisionEvaluationBuilderMock.evaluate()).thenThrow(new NotFoundException(message));
Map<String, Object> json = new HashMap<String, Object>();
json.put("variables", Collections.emptyMap());
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).contentType(ContentType.JSON).body("type", is(InvalidRequestException.class.getSimpleName())).body("message", containsString(message)).when().post(EVALUATE_DECISION_URL);
}
use of org.camunda.bpm.engine.exception.NotFoundException in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceInteractionTest method testRedeployThrowsNotFoundException.
@Test
public void testRedeployThrowsNotFoundException() {
String message = "deployment not found";
doThrow(new NotFoundException(message)).when(mockDeploymentBuilder).deployWithResult();
String expected = "Cannot redeploy deployment '" + MockProvider.EXAMPLE_DEPLOYMENT_ID + "': " + message;
given().pathParam("id", MockProvider.EXAMPLE_DEPLOYMENT_ID).contentType(POST_JSON_CONTENT_TYPE).expect().statusCode(Status.NOT_FOUND.getStatusCode()).body("type", is(InvalidRequestException.class.getSimpleName())).body("message", is(expected)).when().post(REDEPLOY_DEPLOYMENT_URL);
}
use of org.camunda.bpm.engine.exception.NotFoundException in project camunda-bpm-platform by camunda.
the class JobDefinitionRestServiceInteractionTest method testResetNonExistingJobDefinitionPriority.
@Test
public void testResetNonExistingJobDefinitionPriority() {
String expectedMessage = "expected exception message";
doThrow(new NotFoundException(expectedMessage)).when(mockManagementService).clearOverridingJobPriorityForJobDefinition(MockProvider.NON_EXISTING_JOB_DEFINITION_ID);
Map<String, Object> priorityJson = new HashMap<String, Object>();
priorityJson.put("priority", null);
given().pathParam("id", MockProvider.NON_EXISTING_JOB_DEFINITION_ID).contentType(ContentType.JSON).body(priorityJson).then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).body("type", equalTo(InvalidRequestException.class.getSimpleName())).body("message", equalTo(expectedMessage)).when().put(JOB_DEFINITION_PRIORITY_URL);
}
Aggregations