public static List<CleanableHistoricBatchReportResultDto> convert(List<CleanableHistoricBatchReportResult> reportResult) { List<CleanableHistoricBatchReportResultDto> dtos = new ArrayList<CleanableHistoricBatchReportResultDto>(); for (CleanableHistoricBatchReportResult current : reportResult) { CleanableHistoricBatchReportResultDto dto = new CleanableHistoricBatchReportResultDto(); dto.setBatchType(current.getBatchType()); dto.setHistoryTimeToLive(current.getHistoryTimeToLive()); dto.setFinishedBatchesCount(current.getFinishedBatchesCount()); dto.setCleanableBatchesCount(current.getCleanableBatchesCount()); dtos.add(dto); } return dtos; }
public static List<CleanableHistoricBatchReportResultDto> convert(List<CleanableHistoricBatchReportResult> reportResult) { List<CleanableHistoricBatchReportResultDto> dtos = new ArrayList<CleanableHistoricBatchReportResultDto>(); for (CleanableHistoricBatchReportResult current : reportResult) { CleanableHistoricBatchReportResultDto dto = new CleanableHistoricBatchReportResultDto(); dto.setBatchType(current.getBatchType()); dto.setHistoryTimeToLive(current.getHistoryTimeToLive()); dto.setFinishedBatchesCount(current.getFinishedBatchesCount()); dto.setCleanableBatchesCount(current.getCleanableBatchesCount()); dtos.add(dto); } return dtos; }
private void setupHistoryReportMock() { CleanableHistoricBatchReport report = mock(CleanableHistoricBatchReport.class); CleanableHistoricBatchReportResult reportResult = mock(CleanableHistoricBatchReportResult.class); when(reportResult.getBatchType()).thenReturn(EXAMPLE_TYPE); when(reportResult.getHistoryTimeToLive()).thenReturn(EXAMPLE_TTL); when(reportResult.getFinishedBatchesCount()).thenReturn(EXAMPLE_FINISHED_COUNT); when(reportResult.getCleanableBatchesCount()).thenReturn(EXAMPLE_CLEANABLE_COUNT); CleanableHistoricBatchReportResult anotherReportResult = mock(CleanableHistoricBatchReportResult.class); when(anotherReportResult.getBatchType()).thenReturn("batchId2"); when(anotherReportResult.getHistoryTimeToLive()).thenReturn(null); when(anotherReportResult.getFinishedBatchesCount()).thenReturn(13l); when(anotherReportResult.getCleanableBatchesCount()).thenReturn(0l); List<CleanableHistoricBatchReportResult> mocks = new ArrayList<CleanableHistoricBatchReportResult>(); mocks.add(reportResult); mocks.add(anotherReportResult); when(report.list()).thenReturn(mocks); when(report.count()).thenReturn((long) mocks.size()); historicBatchReport = report; when(processEngine.getHistoryService().createCleanableHistoricBatchReport()).thenReturn(historicBatchReport); }
private void checkResultNumbers(CleanableHistoricBatchReportResult result, int expectedCleanable, int expectedFinished, Integer expectedTTL) { assertEquals(expectedCleanable, result.getCleanableBatchesCount()); assertEquals(expectedFinished, result.getFinishedBatchesCount()); assertEquals(expectedTTL, result.getHistoryTimeToLive()); }
private void checkResultNumbers(CleanableHistoricBatchReportResult result, int expectedCleanable, int expectedFinished, Integer expectedTTL) { assertEquals(expectedCleanable, result.getCleanableBatchesCount()); assertEquals(expectedFinished, result.getFinishedBatchesCount()); assertEquals(expectedTTL, result.getHistoryTimeToLive()); }
public static List<CleanableHistoricBatchReportResultDto> convert(List<CleanableHistoricBatchReportResult> reportResult) { List<CleanableHistoricBatchReportResultDto> dtos = new ArrayList<CleanableHistoricBatchReportResultDto>(); for (CleanableHistoricBatchReportResult current : reportResult) { CleanableHistoricBatchReportResultDto dto = new CleanableHistoricBatchReportResultDto(); dto.setBatchType(current.getBatchType()); dto.setHistoryTimeToLive(current.getHistoryTimeToLive()); dto.setFinishedBatchesCount(current.getFinishedBatchesCount()); dto.setCleanableBatchesCount(current.getCleanableBatchesCount()); dtos.add(dto); } return dtos; }
private void checkResultNumbers(CleanableHistoricBatchReportResult result, int expectedCleanable, int expectedFinished, Integer expectedTTL) { assertEquals(expectedCleanable, result.getCleanableBatchesCount()); assertEquals(expectedFinished, result.getFinishedBatchesCount()); assertEquals(expectedTTL, result.getHistoryTimeToLive()); }
private void checkResultNumbers(CleanableHistoricBatchReportResult result, int expectedCleanable, int expectedFinished, Integer expectedTTL) { assertEquals(expectedCleanable, result.getCleanableBatchesCount()); assertEquals(expectedFinished, result.getFinishedBatchesCount()); assertEquals(expectedTTL, result.getHistoryTimeToLive()); }