@Test @RunWithCustomExecutor public void appendUnitEntries() throws Exception { List<PurgeUnitReportEntry> entries = Arrays.asList( new PurgeUnitReportEntry("unit1", "sp1", "opi1", "got1", PurgeUnitStatus.DELETED.name()), new PurgeUnitReportEntry("unit2", "sp2", "opi2", "got2", PurgeUnitStatus.NON_DESTROYABLE_HAS_CHILD_UNITS.name()) ); instance.appendUnitEntries(PROC_ID, entries); ArgumentCaptor<ReportBody> reportBodyArgumentCaptor = ArgumentCaptor.forClass(ReportBody.class); verify(batchReportClient).appendReportEntries(reportBodyArgumentCaptor.capture()); ReportBody<PurgeUnitReportEntry> reportBody = reportBodyArgumentCaptor.getValue(); assertThat(reportBody.getReportType()).isEqualTo(ReportType.PURGE_UNIT); assertThat(reportBody.getProcessId()).isEqualTo(PROC_ID); assertThat(reportBody.getEntries()).hasSize(2); PurgeUnitReportEntry unitEntry = reportBody.getEntries().get(0); assertThat(unitEntry.getId()).isEqualTo("unit1"); assertThat(unitEntry.getInitialOperation()).isEqualTo("opi1"); assertThat(unitEntry.getOriginatingAgency()).isEqualTo("sp1"); assertThat(unitEntry.getObjectGroupId()).isEqualTo("got1"); assertThat(unitEntry.getStatus()).isEqualTo(PurgeUnitStatus.DELETED.name()); }
public void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries) throws ProcessingStatusException { appendEntries(processId, entries, ReportType.PURGE_UNIT); }
PurgeReportService { public void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries) throws ProcessingStatusException { appendEntries(processId, entries, ReportType.PURGE_UNIT); } }
PurgeReportService { public void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries) throws ProcessingStatusException { appendEntries(processId, entries, ReportType.PURGE_UNIT); } PurgeReportService(); @VisibleForTesting  PurgeReportService(
        BatchReportClientFactory batchReportClientFactory,
        WorkspaceClientFactory workspaceClientFactory); }
PurgeReportService { public void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries) throws ProcessingStatusException { appendEntries(processId, entries, ReportType.PURGE_UNIT); } PurgeReportService(); @VisibleForTesting  PurgeReportService(
        BatchReportClientFactory batchReportClientFactory,
        WorkspaceClientFactory workspaceClientFactory); void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries); void appendObjectGroupEntries(String processId, List<PurgeObjectGroupReportEntry> entries); CloseableIterator<String> exportDistinctObjectGroups(String processId); void exportAccessionRegisters(String processId); void cleanupReport(String processId); }
PurgeReportService { public void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries) throws ProcessingStatusException { appendEntries(processId, entries, ReportType.PURGE_UNIT); } PurgeReportService(); @VisibleForTesting  PurgeReportService(
        BatchReportClientFactory batchReportClientFactory,
        WorkspaceClientFactory workspaceClientFactory); void appendUnitEntries(String processId, List<PurgeUnitReportEntry> entries); void appendObjectGroupEntries(String processId, List<PurgeObjectGroupReportEntry> entries); CloseableIterator<String> exportDistinctObjectGroups(String processId); void exportAccessionRegisters(String processId); void cleanupReport(String processId);  }