示例#1
0
//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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
            }
        }