@Test public void should_return_disable_lfc_item_status_when_nothing_to_update() throws Exception { WorkflowBatchResults noGeneratedIOrIdentifiedBatch = getWorkflowBatchResults(getOutputPreservation(EXTRACT)); TestHandlerIO testHandlerIO = new TestHandlerIO(); testHandlerIO.addOutputResult(0, noGeneratedIOrIdentifiedBatch); testHandlerIO.setInputs(noGeneratedIOrIdentifiedBatch); List<ItemStatus> itemStatuses = plugin.executeList(parameter, testHandlerIO); assertThat(itemStatuses) .extracting(ItemStatus::isLifecycleEnable) .containsOnly(false); }
@Override public List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler) { LOGGER.info("Starting {}", PLUGIN_NAME); WorkflowBatchResults results = (WorkflowBatchResults) handler.getInput(0); List<WorkflowBatchResult> workflowBatchResults = results.getWorkflowBatchResults(); try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { return workflowBatchResults.stream() .map(w -> updateObjectGroupModel(w, metaDataClient)) .collect(Collectors.toList()); } }
PreservationUpdateObjectGroupPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler) { LOGGER.info("Starting {}", PLUGIN_NAME); WorkflowBatchResults results = (WorkflowBatchResults) handler.getInput(0); List<WorkflowBatchResult> workflowBatchResults = results.getWorkflowBatchResults(); try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { return workflowBatchResults.stream() .map(w -> updateObjectGroupModel(w, metaDataClient)) .collect(Collectors.toList()); } } }
PreservationUpdateObjectGroupPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler) { LOGGER.info("Starting {}", PLUGIN_NAME); WorkflowBatchResults results = (WorkflowBatchResults) handler.getInput(0); List<WorkflowBatchResult> workflowBatchResults = results.getWorkflowBatchResults(); try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { return workflowBatchResults.stream() .map(w -> updateObjectGroupModel(w, metaDataClient)) .collect(Collectors.toList()); } } PreservationUpdateObjectGroupPlugin(); @VisibleForTesting  PreservationUpdateObjectGroupPlugin(MetaDataClientFactory metaDataClientFactory); }
PreservationUpdateObjectGroupPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler) { LOGGER.info("Starting {}", PLUGIN_NAME); WorkflowBatchResults results = (WorkflowBatchResults) handler.getInput(0); List<WorkflowBatchResult> workflowBatchResults = results.getWorkflowBatchResults(); try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { return workflowBatchResults.stream() .map(w -> updateObjectGroupModel(w, metaDataClient)) .collect(Collectors.toList()); } } PreservationUpdateObjectGroupPlugin(); @VisibleForTesting  PreservationUpdateObjectGroupPlugin(MetaDataClientFactory metaDataClientFactory); @Override List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler); }
PreservationUpdateObjectGroupPlugin extends ActionHandler { @Override public List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler) { LOGGER.info("Starting {}", PLUGIN_NAME); WorkflowBatchResults results = (WorkflowBatchResults) handler.getInput(0); List<WorkflowBatchResult> workflowBatchResults = results.getWorkflowBatchResults(); try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { return workflowBatchResults.stream() .map(w -> updateObjectGroupModel(w, metaDataClient)) .collect(Collectors.toList()); } } PreservationUpdateObjectGroupPlugin(); @VisibleForTesting  PreservationUpdateObjectGroupPlugin(MetaDataClientFactory metaDataClientFactory); @Override List<ItemStatus> executeList(WorkerParameters workerParameters, HandlerIO handler);  }