@Test public void execute_whenExportFailedThenExpectFatal() throws Exception { HashSetValuedHashMap<String, String> attachments = new HashSetValuedHashMap<>(); attachments.put("id1", "id2"); HashSetValuedHashMap<String, String> detachments = new HashSetValuedHashMap<>(); detachments.put("id1", "id3"); ReclassificationOrders reclassificationOrders = new ReclassificationOrders(attachments, detachments); doReturn(reclassificationOrders).when(handlerIO).getInput(0); doThrow(MetaDataExecutionException.class).when(metaDataClient) .exportReclassificationChildNodes(any(), any(), any()); ItemStatus itemStatus = reclassificationPreparationLoadHandlerPlugin.execute(parameters, handlerIO); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.FATAL); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { ReclassificationOrders reclassificationOrders = loadReclassificationOrders(handler); prepareUpdates(reclassificationOrders, handler); } catch (ProcessingStatusException e) { LOGGER.error("Reclassification update distribution failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, e.getStatusCode(), e.getEventDetails()); } LOGGER.info("Reclassification update distribution succeeded"); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, StatusCode.OK, null); }
ReclassificationPreparationUpdateDistributionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { ReclassificationOrders reclassificationOrders = loadReclassificationOrders(handler); prepareUpdates(reclassificationOrders, handler); } catch (ProcessingStatusException e) { LOGGER.error("Reclassification update distribution failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, e.getStatusCode(), e.getEventDetails()); } LOGGER.info("Reclassification update distribution succeeded"); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, StatusCode.OK, null); } }
ReclassificationPreparationUpdateDistributionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { ReclassificationOrders reclassificationOrders = loadReclassificationOrders(handler); prepareUpdates(reclassificationOrders, handler); } catch (ProcessingStatusException e) { LOGGER.error("Reclassification update distribution failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, e.getStatusCode(), e.getEventDetails()); } LOGGER.info("Reclassification update distribution succeeded"); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, StatusCode.OK, null); } ReclassificationPreparationUpdateDistributionHandler(); @VisibleForTesting  ReclassificationPreparationUpdateDistributionHandler(MetaDataClientFactory metaDataClientFactory); }
ReclassificationPreparationUpdateDistributionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { ReclassificationOrders reclassificationOrders = loadReclassificationOrders(handler); prepareUpdates(reclassificationOrders, handler); } catch (ProcessingStatusException e) { LOGGER.error("Reclassification update distribution failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, e.getStatusCode(), e.getEventDetails()); } LOGGER.info("Reclassification update distribution succeeded"); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, StatusCode.OK, null); } ReclassificationPreparationUpdateDistributionHandler(); @VisibleForTesting  ReclassificationPreparationUpdateDistributionHandler(MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId(); }
ReclassificationPreparationUpdateDistributionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { ReclassificationOrders reclassificationOrders = loadReclassificationOrders(handler); prepareUpdates(reclassificationOrders, handler); } catch (ProcessingStatusException e) { LOGGER.error("Reclassification update distribution failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, e.getStatusCode(), e.getEventDetails()); } LOGGER.info("Reclassification update distribution succeeded"); return buildItemStatus(RECLASSIFICATION_PREPARATION_UPDATE_DISTRIBUTION, StatusCode.OK, null); } ReclassificationPreparationUpdateDistributionHandler(); @VisibleForTesting  ReclassificationPreparationUpdateDistributionHandler(MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId();  }