use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class HistoricTaskReportRestServiceTest method testTaskCountMissingAuthorization.
@Test
public void testTaskCountMissingAuthorization() {
String message = "not authorized";
when(mockedReportQuery.countByTaskName()).thenThrow(new AuthorizationException(message));
given().queryParam("reportType", "count").queryParam("groupBy", "taskName").then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().get(TASK_REPORT_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class HistoricTaskReportRestServiceTest method testTaskCountByProcDefMissingAuthorization.
@Test
public void testTaskCountByProcDefMissingAuthorization() {
String message = "not authorized";
when(mockedReportQuery.countByProcessDefinitionKey()).thenThrow(new AuthorizationException(message));
given().queryParam("reportType", "count").queryParam("groupBy", "processDefinition").then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().get(TASK_REPORT_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class HistoricTaskReportRestServiceTest method testTaskDurationMonthMissingAuthorization.
// TASK DURATION REPORT ///////////////////////////////////////////////////////
@Test
public void testTaskDurationMonthMissingAuthorization() {
String message = "not authorized";
when(mockedReportQuery.duration(MONTH)).thenThrow(new AuthorizationException(message));
given().queryParam("reportType", "duration").queryParam("periodUnit", "month").then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().get(TASK_REPORT_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class HistoricTaskReportRestServiceTest method testTaskDurationQuarterMissingAuthorization.
@Test
public void testTaskDurationQuarterMissingAuthorization() {
String message = "not authorized";
when(mockedReportQuery.duration(QUARTER)).thenThrow(new AuthorizationException(message));
given().queryParam("reportType", "duration").queryParam("periodUnit", "quarter").then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().get(TASK_REPORT_URL);
}
use of org.camunda.bpm.engine.AuthorizationException in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceRestServiceInteractionTest method testDeleteProcessInstanceThrowsAuthorizationException.
@Test
public void testDeleteProcessInstanceThrowsAuthorizationException() {
String message = "expected exception";
doThrow(new AuthorizationException(message)).when(historyServiceMock).deleteHistoricProcessInstance(anyString());
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(AuthorizationException.class.getSimpleName())).body("message", equalTo(message)).when().delete(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);
}
Aggregations