@Test @RunWithCustomExecutor public void testIndexUnitOK() throws Exception { instance.execute(parameters, handlerIO); ArgumentCaptor<JsonNode> updateDsl = ArgumentCaptor.forClass(JsonNode.class); verify(metaDataClient).updateUnitById(updateDsl.capture(), eq("unit1")); String update = JsonHandler.unprettyPrint(updateDsl.getValue()); assertThat(update).contains("{\"$push\":{\"#elimination\""); assertThat(update).contains("\"OperationId\":\"opId\""); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationAnalysisResult eliminationAnalysisResult = getUnitEliminationAnalysisResult(param); String unitId = param.getObjectName(); indexUnit(unitId, eliminationAnalysisResult); LOGGER.info("Elimination analysis unit indexation succeeded"); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Elimination analysis unit indexation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, e.getStatusCode(), e.getEventDetails()); } }
EliminationAnalysisUnitIndexationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationAnalysisResult eliminationAnalysisResult = getUnitEliminationAnalysisResult(param); String unitId = param.getObjectName(); indexUnit(unitId, eliminationAnalysisResult); LOGGER.info("Elimination analysis unit indexation succeeded"); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Elimination analysis unit indexation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, e.getStatusCode(), e.getEventDetails()); } } }
EliminationAnalysisUnitIndexationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationAnalysisResult eliminationAnalysisResult = getUnitEliminationAnalysisResult(param); String unitId = param.getObjectName(); indexUnit(unitId, eliminationAnalysisResult); LOGGER.info("Elimination analysis unit indexation succeeded"); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Elimination analysis unit indexation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, e.getStatusCode(), e.getEventDetails()); } } EliminationAnalysisUnitIndexationPlugin(); @VisibleForTesting  EliminationAnalysisUnitIndexationPlugin(
        MetaDataClientFactory metaDataClientFactory); }
EliminationAnalysisUnitIndexationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationAnalysisResult eliminationAnalysisResult = getUnitEliminationAnalysisResult(param); String unitId = param.getObjectName(); indexUnit(unitId, eliminationAnalysisResult); LOGGER.info("Elimination analysis unit indexation succeeded"); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Elimination analysis unit indexation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, e.getStatusCode(), e.getEventDetails()); } } EliminationAnalysisUnitIndexationPlugin(); @VisibleForTesting  EliminationAnalysisUnitIndexationPlugin(
        MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId(); }
EliminationAnalysisUnitIndexationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationAnalysisResult eliminationAnalysisResult = getUnitEliminationAnalysisResult(param); String unitId = param.getObjectName(); indexUnit(unitId, eliminationAnalysisResult); LOGGER.info("Elimination analysis unit indexation succeeded"); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error("Elimination analysis unit indexation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ANALYSIS_UNIT_INDEXATION, e.getStatusCode(), e.getEventDetails()); } } EliminationAnalysisUnitIndexationPlugin(); @VisibleForTesting  EliminationAnalysisUnitIndexationPlugin(
        MetaDataClientFactory metaDataClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId();  }