@Test @RunWithCustomExecutor public void testExecute_OK() throws Exception { ItemStatus itemStatus = instance.execute(params, handler); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.OK); verify(purgeDeleteService) .detachObjectGroupFromDeleteParentUnits(eq("id_got_1"), eq(new HashSet<>(singletonList("id_unit_1")))); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { String objectGroupId = param.getObjectName(); try { Set<String> parentUnitsToRemove = getParentUnitsToRemove(param); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" + " from object group " + objectGroupId); } purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove); LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" + " [" + e.getStatusCode() + "]", e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } }
PurgeDetachObjectGroupPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { String objectGroupId = param.getObjectName(); try { Set<String> parentUnitsToRemove = getParentUnitsToRemove(param); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" + " from object group " + objectGroupId); } purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove); LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" + " [" + e.getStatusCode() + "]", e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } }
PurgeDetachObjectGroupPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { String objectGroupId = param.getObjectName(); try { Set<String> parentUnitsToRemove = getParentUnitsToRemove(param); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" + " from object group " + objectGroupId); } purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove); LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" + " [" + e.getStatusCode() + "]", e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeDetachObjectGroupPlugin(String actionId); @VisibleForTesting protected  PurgeDetachObjectGroupPlugin(
        String actionId, PurgeDeleteService purgeDeleteService); }
PurgeDetachObjectGroupPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { String objectGroupId = param.getObjectName(); try { Set<String> parentUnitsToRemove = getParentUnitsToRemove(param); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" + " from object group " + objectGroupId); } purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove); LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" + " [" + e.getStatusCode() + "]", e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeDetachObjectGroupPlugin(String actionId); @VisibleForTesting protected  PurgeDetachObjectGroupPlugin(
        String actionId, PurgeDeleteService purgeDeleteService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); }
PurgeDetachObjectGroupPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { String objectGroupId = param.getObjectName(); try { Set<String> parentUnitsToRemove = getParentUnitsToRemove(param); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" + " from object group " + objectGroupId); } purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove); LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" + " [" + e.getStatusCode() + "]", e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeDetachObjectGroupPlugin(String actionId); @VisibleForTesting protected  PurgeDetachObjectGroupPlugin(
        String actionId, PurgeDeleteService purgeDeleteService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler);  }