@Test @RunWithCustomExecutor public void exportAccessionRegisters() throws Exception { InputStream is = PropertiesUtils.getResourceAsStream( "EliminationAction/EliminationActionObjectGroupReportService/objectGroupReport.jsonl"); Response response = mock(Response.class); doReturn(is).when(response).readEntity(InputStream.class); doReturn(response).when(workspaceClient).getObject(PROC_ID, OBJECT_GROUP_REPORT_JSONL); instance.exportAccessionRegisters(PROC_ID); ArgumentCaptor<ReportExportRequest> reportExportRequestArgumentCaptor = ArgumentCaptor.forClass(ReportExportRequest.class); verify(batchReportClient) .generatePurgeAccessionRegisterReport(eq(PROC_ID), reportExportRequestArgumentCaptor.capture()); assertThat(reportExportRequestArgumentCaptor.getValue().getFilename()) .isEqualTo(ACCESSION_REGISTER_REPORT_JSONL); }
public void exportAccessionRegisters(String processId) throws ProcessingStatusException { try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) { batchReportClient.generatePurgeAccessionRegisterReport( processId, new ReportExportRequest(ACCESSION_REGISTER_REPORT_JSONL)); } catch (VitamClientInternalException e) { throw new ProcessingStatusException(StatusCode.FATAL, "Could not generate purge accession register reports (" + processId + ")", e); } }
PurgeReportService { public void exportAccessionRegisters(String processId) throws ProcessingStatusException { try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) { batchReportClient.generatePurgeAccessionRegisterReport( processId, new ReportExportRequest(ACCESSION_REGISTER_REPORT_JSONL)); } catch (VitamClientInternalException e) { throw new ProcessingStatusException(StatusCode.FATAL, "Could not generate purge accession register reports (" + processId + ")", e); } } }
PurgeReportService { public void exportAccessionRegisters(String processId) throws ProcessingStatusException { try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) { batchReportClient.generatePurgeAccessionRegisterReport( processId, new ReportExportRequest(ACCESSION_REGISTER_REPORT_JSONL)); } catch (VitamClientInternalException e) { throw new ProcessingStatusException(StatusCode.FATAL, "Could not generate purge accession register reports (" + processId + ")", e); } } PurgeReportService(); @VisibleForTesting  PurgeReportService(
        BatchReportClientFactory batchReportClientFactory,
        WorkspaceClientFactory workspaceClientFactory); }
PurgeReportService { public void exportAccessionRegisters(String processId) throws ProcessingStatusException { try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) { batchReportClient.generatePurgeAccessionRegisterReport( processId, new ReportExportRequest(ACCESSION_REGISTER_REPORT_JSONL)); } catch (VitamClientInternalException e) { throw new ProcessingStatusException(StatusCode.FATAL, "Could not generate purge accession register reports (" + processId + ")", e); } } 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 exportAccessionRegisters(String processId) throws ProcessingStatusException { try (BatchReportClient batchReportClient = batchReportClientFactory.getClient()) { batchReportClient.generatePurgeAccessionRegisterReport( processId, new ReportExportRequest(ACCESSION_REGISTER_REPORT_JSONL)); } catch (VitamClientInternalException e) { throw new ProcessingStatusException(StatusCode.FATAL, "Could not generate purge accession register reports (" + processId + ")", e); } } 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);  }