Search in sources :

Example 6 with ProcessInstanceSuspensionStateDto

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);
}
Also used : ProcessInstanceSuspensionStateDto(org.camunda.bpm.engine.rest.dto.runtime.ProcessInstanceSuspensionStateDto) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) Test(org.junit.Test)

Aggregations

ProcessInstanceSuspensionStateDto (org.camunda.bpm.engine.rest.dto.runtime.ProcessInstanceSuspensionStateDto)6 Test (org.junit.Test)6 AuthorizationException (org.camunda.bpm.engine.AuthorizationException)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2