@Test @RunWithCustomExecutor public void testIndexUnitOnMetadataExceptionThenFatal() throws Exception { doThrow(MetaDataExecutionException.class).when(metaDataClient).updateUnitById(any(), any()); ItemStatus itemStatus = instance.execute(parameters, handlerIO); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.FATAL); }
@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();  }