//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(historicCaseInstanceReport.list()).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(HISTORIC_REPORT_URL); }
public virtual IList <CleanableHistoricCaseInstanceReportResultDto> getCleanableHistoricCaseInstanceReport(UriInfo uriInfo, int?firstResult, int?maxResults) { CleanableHistoricCaseInstanceReportDto queryDto = new CleanableHistoricCaseInstanceReportDto(objectMapper, uriInfo.QueryParameters); CleanableHistoricCaseInstanceReport query = queryDto.toQuery(processEngine); IList <CleanableHistoricCaseInstanceReportResult> reportResult; if (firstResult != null || maxResults != null) { reportResult = executePaginatedQuery(query, firstResult, maxResults); } else { reportResult = query.list(); } return(CleanableHistoricCaseInstanceReportResultDto.convert(reportResult)); }
private void setupHistoryReportMock() { CleanableHistoricCaseInstanceReport report = mock(typeof(CleanableHistoricCaseInstanceReport)); when(report.caseDefinitionIdIn(anyString())).thenReturn(report); when(report.caseDefinitionKeyIn(anyString())).thenReturn(report); CleanableHistoricCaseInstanceReportResult reportResult = mock(typeof(CleanableHistoricCaseInstanceReportResult)); when(reportResult.CaseDefinitionId).thenReturn(EXAMPLE_CD_ID); when(reportResult.CaseDefinitionKey).thenReturn(EXAMPLE_CD_KEY); when(reportResult.CaseDefinitionName).thenReturn(EXAMPLE_CD_NAME); when(reportResult.CaseDefinitionVersion).thenReturn(EXAMPLE_CD_VERSION); when(reportResult.HistoryTimeToLive).thenReturn(EXAMPLE_TTL); when(reportResult.FinishedCaseInstanceCount).thenReturn(EXAMPLE_FINISHED_CI_COUNT); when(reportResult.CleanableCaseInstanceCount).thenReturn(EXAMPLE_CLEANABLE_CI_COUNT); when(reportResult.TenantId).thenReturn(EXAMPLE_TENANT_ID); CleanableHistoricCaseInstanceReportResult anotherReportResult = mock(typeof(CleanableHistoricCaseInstanceReportResult)); when(anotherReportResult.CaseDefinitionId).thenReturn(ANOTHER_EXAMPLE_CD_ID); when(anotherReportResult.CaseDefinitionKey).thenReturn(ANOTHER_EXAMPLE_CD_KEY); when(anotherReportResult.CaseDefinitionName).thenReturn("cdName"); when(anotherReportResult.CaseDefinitionVersion).thenReturn(33); when(anotherReportResult.HistoryTimeToLive).thenReturn(null); when(anotherReportResult.FinishedCaseInstanceCount).thenReturn(13l); when(anotherReportResult.CleanableCaseInstanceCount).thenReturn(0l); when(anotherReportResult.TenantId).thenReturn(ANOTHER_EXAMPLE_TENANT_ID); IList <CleanableHistoricCaseInstanceReportResult> mocks = new List <CleanableHistoricCaseInstanceReportResult>(); mocks.Add(reportResult); mocks.Add(anotherReportResult); when(report.list()).thenReturn(mocks); when(report.count()).thenReturn((long)mocks.Count); historicCaseInstanceReport = report; when(processEngine.HistoryService.createCleanableHistoricCaseInstanceReport()).thenReturn(historicCaseInstanceReport); }