use of org.camunda.bpm.engine.rest.dto.runtime.ProcessInstanceSuspensionStateDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testSuspendThrowsProcessEngineException.
@Test
public void testSuspendThrowsProcessEngineException() {
ProcessInstanceSuspensionStateDto dto = new ProcessInstanceSuspensionStateDto();
dto.setSuspended(true);
String expectedMessage = "expectedMessage";
doThrow(new ProcessEngineException(expectedMessage)).when(mockUpdateSuspensionStateBuilder).suspend();
given().pathParam("id", MockProvider.EXAMPLE_NON_EXISTENT_PROCESS_INSTANCE_ID).contentType(ContentType.JSON).body(dto).then().expect().statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode()).body("type", is(ProcessEngineException.class.getSimpleName())).body("message", is(expectedMessage)).when().put(SINGLE_PROCESS_INSTANCE_SUSPENDED_URL);
}
Aggregations