use of org.camunda.bpm.engine.rest.dto.runtime.JobSuspensionStateDto in project camunda-bpm-platform by camunda.
the class JobRestServiceInteractionTest method testSuspendThrowsAuthorizationException.
@Test
public void testSuspendThrowsAuthorizationException() {
JobSuspensionStateDto dto = new JobSuspensionStateDto();
dto.setSuspended(true);
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage)).when(mockSuspensionStateBuilder).suspend();
given().pathParam("id", MockProvider.EXAMPLE_JOB_ID).contentType(ContentType.JSON).body(dto).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", is(AuthorizationException.class.getSimpleName())).body("message", is(expectedMessage)).when().put(SINGLE_JOB_SUSPENDED_URL);
}
Aggregations