private void setupHistoryReportMock() { CleanableHistoricBatchReport report = mock(typeof(CleanableHistoricBatchReport)); CleanableHistoricBatchReportResult reportResult = mock(typeof(CleanableHistoricBatchReportResult)); when(reportResult.BatchType).thenReturn(EXAMPLE_TYPE); when(reportResult.HistoryTimeToLive).thenReturn(EXAMPLE_TTL); when(reportResult.FinishedBatchesCount).thenReturn(EXAMPLE_FINISHED_COUNT); when(reportResult.CleanableBatchesCount).thenReturn(EXAMPLE_CLEANABLE_COUNT); CleanableHistoricBatchReportResult anotherReportResult = mock(typeof(CleanableHistoricBatchReportResult)); when(anotherReportResult.BatchType).thenReturn("batchId2"); when(anotherReportResult.HistoryTimeToLive).thenReturn(null); when(anotherReportResult.FinishedBatchesCount).thenReturn(13l); when(anotherReportResult.CleanableBatchesCount).thenReturn(0l); IList <CleanableHistoricBatchReportResult> mocks = new List <CleanableHistoricBatchReportResult>(); mocks.Add(reportResult); mocks.Add(anotherReportResult); when(report.list()).thenReturn(mocks); when(report.count()).thenReturn((long)mocks.Count); historicBatchReport = report; when(processEngine.HistoryService.createCleanableHistoricBatchReport()).thenReturn(historicBatchReport); }
public virtual CountResultDto getCleanableHistoricBatchesReportCount(UriInfo uriInfo) { CleanableHistoricBatchReportDto queryDto = new CleanableHistoricBatchReportDto(objectMapper, uriInfo.QueryParameters); queryDto.ObjectMapper = objectMapper; CleanableHistoricBatchReport query = queryDto.toQuery(processEngine); long count = query.count(); CountResultDto result = new CountResultDto(); result.Count = count; return(result); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") @Override public java.util.List<org.camunda.bpm.engine.rest.dto.history.batch.CleanableHistoricBatchReportResultDto> getCleanableHistoricBatchesReport(javax.ws.rs.core.UriInfo uriInfo, System.Nullable<int> firstResult, System.Nullable<int> maxResults) public virtual IList <CleanableHistoricBatchReportResultDto> getCleanableHistoricBatchesReport(UriInfo uriInfo, int?firstResult, int?maxResults) { CleanableHistoricBatchReportDto queryDto = new CleanableHistoricBatchReportDto(objectMapper, uriInfo.QueryParameters); CleanableHistoricBatchReport query = queryDto.toQuery(processEngine); IList <CleanableHistoricBatchReportResult> reportResult; if (firstResult != null || maxResults != null) { reportResult = (IList <CleanableHistoricBatchReportResult>)executePaginatedQuery(query, firstResult, maxResults); } else { reportResult = query.list(); } return(CleanableHistoricBatchReportResultDto.convert(reportResult)); }