//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testMissingAuthorization() public virtual void testMissingAuthorization() { string message = "not authorized"; when(mockedReportQuery.taskCountByCandidateGroup()).thenThrow(new AuthorizationException(message)); given().then().expect().statusCode(Status.FORBIDDEN.StatusCode).contentType(ContentType.JSON).body("type", equalTo(typeof(AuthorizationException).Name)).body("message", equalTo(message)).when().get(CANDIDATE_GROUP_REPORT_URL); }
private TaskReport setUpMockHistoricProcessInstanceReportQuery() { TaskReport mockedReportQuery = mock(typeof(TaskReport)); IList <TaskCountByCandidateGroupResult> taskCountByCandidateGroupResults = createMockTaskCountByCandidateGroupReport(); when(mockedReportQuery.taskCountByCandidateGroup()).thenReturn(taskCountByCandidateGroupResults); when(processEngine.TaskService.createTaskReport()).thenReturn(mockedReportQuery); return(mockedReportQuery); }
public virtual IList <TaskCountByCandidateGroupResult> executeTaskCountByCandidateGroupReport(ProcessEngine engine) { TaskReport reportQuery = engine.TaskService.createTaskReport(); try { return(reportQuery.taskCountByCandidateGroup()); } catch (NotValidException e) { throw new InvalidRequestException(Response.Status.BAD_REQUEST, e, e.Message); } }