use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testPutUpdateTaskThrowsAuthorizationException.
@Test
public void testPutUpdateTaskThrowsAuthorizationException() {
Map<String, Object> json = new HashMap<String, Object>();
json.put("delegationState", "pending");
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(taskServiceMock).saveTask(any(Task.class));
given().pathParam("id", MockProvider.EXAMPLE_TASK_ID).contentType(ContentType.JSON).body(json).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().put(SINGLE_TASK_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testResolveTaskThrowsAuthorizationException.
@Test
public void testResolveTaskThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(taskServiceMock).resolveTask(anyString(), Matchers.<Map<String, Object>>any());
given().pathParam("id", EXAMPLE_TASK_ID).contentType(POST_JSON_CONTENT_TYPE).body(EMPTY_JSON_OBJECT).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().post(RESOLVE_TASK_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testClaimTaskThrowsAuthorizationException.
@Test
public void testClaimTaskThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(taskServiceMock).claim(anyString(), anyString());
given().pathParam("id", EXAMPLE_TASK_ID).header("accept", MediaType.APPLICATION_JSON).contentType(POST_JSON_CONTENT_TYPE).body(EMPTY_JSON_OBJECT).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().post(CLAIM_TASK_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testDelegateTaskThrowsAuthorizationException.
@Test
public void testDelegateTaskThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(taskServiceMock).delegateTask(anyString(), anyString());
given().pathParam("id", EXAMPLE_TASK_ID).header("accept", MediaType.APPLICATION_JSON).contentType(POST_JSON_CONTENT_TYPE).body(EMPTY_JSON_OBJECT).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().post(DELEGATE_TASK_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method testGetFormThrowsAuthorizationException.
@Test
public void testGetFormThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(formServiceMock).getTaskFormData(anyString());
given().pathParam("id", EXAMPLE_TASK_ID).header("accept", MediaType.APPLICATION_JSON).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().get(TASK_FORM_URL);
}
Aggregations