@Test public void should_append_purge_object_group_report() throws Exception { InputStream stream = getClass().getResourceAsStream("/purgeObjectGroupModel.json"); ReportBody reportBody = JsonHandler.getFromInputStream(stream, ReportBody.class, PurgeObjectGroupReportEntry.class); assertThatCode(() -> batchReportServiceImpl .appendPurgeObjectGroupReport(PROCESS_ID, reportBody.getEntries(), TENANT_ID)) .doesNotThrowAnyException(); }
public void appendPurgeObjectGroupReport(String processId, List<PurgeObjectGroupReportEntry> entries, int tenantId) { List<PurgeObjectGroupModel> documents = entries.stream() .map(ogEntry -> new PurgeObjectGroupModel( processId, LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()), ogEntry, tenantId)) .collect(Collectors.toList()); purgeObjectGroupRepository.bulkAppendReport(documents); }
BatchReportServiceImpl { public void appendPurgeObjectGroupReport(String processId, List<PurgeObjectGroupReportEntry> entries, int tenantId) { List<PurgeObjectGroupModel> documents = entries.stream() .map(ogEntry -> new PurgeObjectGroupModel( processId, LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()), ogEntry, tenantId)) .collect(Collectors.toList()); purgeObjectGroupRepository.bulkAppendReport(documents); } }
BatchReportServiceImpl { public void appendPurgeObjectGroupReport(String processId, List<PurgeObjectGroupReportEntry> entries, int tenantId) { List<PurgeObjectGroupModel> documents = entries.stream() .map(ogEntry -> new PurgeObjectGroupModel( processId, LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()), ogEntry, tenantId)) .collect(Collectors.toList()); purgeObjectGroupRepository.bulkAppendReport(documents); } BatchReportServiceImpl(EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository, PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository, WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); @VisibleForTesting  BatchReportServiceImpl(
        EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository,
        PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); }
BatchReportServiceImpl { public void appendPurgeObjectGroupReport(String processId, List<PurgeObjectGroupReportEntry> entries, int tenantId) { List<PurgeObjectGroupModel> documents = entries.stream() .map(ogEntry -> new PurgeObjectGroupModel( processId, LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()), ogEntry, tenantId)) .collect(Collectors.toList()); purgeObjectGroupRepository.bulkAppendReport(documents); } BatchReportServiceImpl(EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository, PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository, WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); @VisibleForTesting  BatchReportServiceImpl(
        EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository,
        PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); void appendEliminationActionUnitReport(String processId, List<EliminationActionUnitReportEntry> entries,
        int tenantId); void appendPurgeUnitReport(String processId, List<PurgeUnitReportEntry> entries,
        int tenantId); void appendPurgeObjectGroupReport(String processId,
        List<PurgeObjectGroupReportEntry> entries, int tenantId); void appendTransferReplyUnitReport(String processId, List<TransferReplyUnitReportEntry> entries,
        int tenantId); void appendPreservationReport(String processId, List<PreservationReportEntry> preservationEntries,
        int tenantId); void appendUnitReport(List<UpdateUnitMetadataReportEntry> unitEntries); void appendUnitComputedInheritedRulesInvalidationReport(String processId,
        List<UnitComputedInheritedRulesInvalidationReportEntry> unitEntries, int tenantId); void deleteUnitComputedInheritedRulesInvalidationReport(String processId, int tenantId); void exportUnitsToInvalidate(String processId, int tenantId, ReportExportRequest reportExportRequest); void appendAuditReport(String processId, List<AuditObjectGroupReportEntry> auditEntries, int tenantId); void appendEvidenceAuditReport(String processId, List<EvidenceAuditReportEntry> auditEntries, int tenantId); void storeReportToWorkspace(Report reportInfo); void exportPurgeDistinctObjectGroupOfDeletedUnits(String processId, String filename,
        int tenantId); void exportPurgeAccessionRegister(String processId, String filename, int tenantId); void deleteEliminationUnitByProcessId(String processId, int tenantId); void deletePurgeUnitByProcessId(String processId, int tenantId); void deletePurgeObjectGroupByIdAndTenant(String processId, int tenantId); void deleteTransferReplyUnitByProcessId(String processId, int tenantId); void deletePreservationByIdAndTenant(String processId, int tenantId); void deleteAuditByIdAndTenant(String processId, int tenantId); void deleteUpdateUnitByIdAndTenant(String processId, int tenantId); void deleteEvidenceAuditByIdAndTenant(String processId, int tenantId); }
BatchReportServiceImpl { public void appendPurgeObjectGroupReport(String processId, List<PurgeObjectGroupReportEntry> entries, int tenantId) { List<PurgeObjectGroupModel> documents = entries.stream() .map(ogEntry -> new PurgeObjectGroupModel( processId, LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()), ogEntry, tenantId)) .collect(Collectors.toList()); purgeObjectGroupRepository.bulkAppendReport(documents); } BatchReportServiceImpl(EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository, PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository, WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); @VisibleForTesting  BatchReportServiceImpl(
        EliminationActionUnitRepository eliminationActionUnitRepository,
        PurgeUnitRepository purgeUnitRepository,
        PurgeObjectGroupRepository purgeObjectGroupRepository,
        TransferReplyUnitRepository transferReplyUnitRepository,
        UpdateUnitReportRepository updateUnitReportRepository,
        WorkspaceClientFactory workspaceClientFactory,
        PreservationReportRepository preservationReportRepository,
        AuditReportRepository auditReportRepository,
        UnitComputedInheritedRulesInvalidationRepository unitComputedInheritedRulesInvalidationRepository,
        EvidenceAuditReportRepository evidenceAuditReportRepository); void appendEliminationActionUnitReport(String processId, List<EliminationActionUnitReportEntry> entries,
        int tenantId); void appendPurgeUnitReport(String processId, List<PurgeUnitReportEntry> entries,
        int tenantId); void appendPurgeObjectGroupReport(String processId,
        List<PurgeObjectGroupReportEntry> entries, int tenantId); void appendTransferReplyUnitReport(String processId, List<TransferReplyUnitReportEntry> entries,
        int tenantId); void appendPreservationReport(String processId, List<PreservationReportEntry> preservationEntries,
        int tenantId); void appendUnitReport(List<UpdateUnitMetadataReportEntry> unitEntries); void appendUnitComputedInheritedRulesInvalidationReport(String processId,
        List<UnitComputedInheritedRulesInvalidationReportEntry> unitEntries, int tenantId); void deleteUnitComputedInheritedRulesInvalidationReport(String processId, int tenantId); void exportUnitsToInvalidate(String processId, int tenantId, ReportExportRequest reportExportRequest); void appendAuditReport(String processId, List<AuditObjectGroupReportEntry> auditEntries, int tenantId); void appendEvidenceAuditReport(String processId, List<EvidenceAuditReportEntry> auditEntries, int tenantId); void storeReportToWorkspace(Report reportInfo); void exportPurgeDistinctObjectGroupOfDeletedUnits(String processId, String filename,
        int tenantId); void exportPurgeAccessionRegister(String processId, String filename, int tenantId); void deleteEliminationUnitByProcessId(String processId, int tenantId); void deletePurgeUnitByProcessId(String processId, int tenantId); void deletePurgeObjectGroupByIdAndTenant(String processId, int tenantId); void deleteTransferReplyUnitByProcessId(String processId, int tenantId); void deletePreservationByIdAndTenant(String processId, int tenantId); void deleteAuditByIdAndTenant(String processId, int tenantId); void deleteUpdateUnitByIdAndTenant(String processId, int tenantId); void deleteEvidenceAuditByIdAndTenant(String processId, int tenantId);  }