@Test @RunWithCustomExecutor public void testExecuteList_OK() throws Exception { WorkerParameters params = WorkerParametersFactory.newWorkerParameters() .setObjectMetadataList(Arrays.asList( buildUnitParams(1), buildUnitParams(2), buildUnitParams(3))); List<ItemStatus> itemStatus = instance.executeList(params, handler); assertThat(itemStatus).hasSize(3); assertThat(itemStatus).allMatch(i -> i.getGlobalStatus() == StatusCode.OK); Map<String, String> unitIdsWithStrategies = ImmutableMap.of( "id_unit_1", "default-fake", "id_unit_2", "default-fake", "id_unit_3", "default-fake"); verify(purgeDeleteService).deleteUnits(eq(unitIdsWithStrategies)); }
@Override public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) { try { return processUnits(param.getObjectMetadataList()); } catch (ProcessingStatusException e) { LOGGER.error("Unit purge failed with status " + e.getStatusCode(), e); return singletonList(buildItemStatus(INGEST_CLEANUP_DELETE_UNIT, e.getStatusCode(), e.getEventDetails())); } }
IngestCleanupDeleteUnitPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) { try { return processUnits(param.getObjectMetadataList()); } catch (ProcessingStatusException e) { LOGGER.error("Unit purge failed with status " + e.getStatusCode(), e); return singletonList(buildItemStatus(INGEST_CLEANUP_DELETE_UNIT, e.getStatusCode(), e.getEventDetails())); } } }
IngestCleanupDeleteUnitPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) { try { return processUnits(param.getObjectMetadataList()); } catch (ProcessingStatusException e) { LOGGER.error("Unit purge failed with status " + e.getStatusCode(), e); return singletonList(buildItemStatus(INGEST_CLEANUP_DELETE_UNIT, e.getStatusCode(), e.getEventDetails())); } } IngestCleanupDeleteUnitPlugin(); @VisibleForTesting  IngestCleanupDeleteUnitPlugin(
        PurgeDeleteService purgeDeleteService); }
IngestCleanupDeleteUnitPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) { try { return processUnits(param.getObjectMetadataList()); } catch (ProcessingStatusException e) { LOGGER.error("Unit purge failed with status " + e.getStatusCode(), e); return singletonList(buildItemStatus(INGEST_CLEANUP_DELETE_UNIT, e.getStatusCode(), e.getEventDetails())); } } IngestCleanupDeleteUnitPlugin(); @VisibleForTesting  IngestCleanupDeleteUnitPlugin(
        PurgeDeleteService purgeDeleteService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler); static String getId(); }
IngestCleanupDeleteUnitPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) { try { return processUnits(param.getObjectMetadataList()); } catch (ProcessingStatusException e) { LOGGER.error("Unit purge failed with status " + e.getStatusCode(), e); return singletonList(buildItemStatus(INGEST_CLEANUP_DELETE_UNIT, e.getStatusCode(), e.getEventDetails())); } } IngestCleanupDeleteUnitPlugin(); @VisibleForTesting  IngestCleanupDeleteUnitPlugin(
        PurgeDeleteService purgeDeleteService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler); static String getId();  }