@Test @RunWithCustomExecutor public void testExecute_FutureDate_Warn() throws Exception { doReturn(PropertiesUtils.getResourceAsStream( "EliminationAction/EliminationActionUnitPreparationHandler/invalidRequestWithFutureDate.json")) .when(handler).getInputStreamFromWorkspace(REQUEST_JSON); ItemStatus itemStatus = instance.execute(params, handler); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.KO); EliminationEventDetails eventDetails = JsonHandler.getFromString(itemStatus.getEvDetailData(), EliminationEventDetails.class); assertThat(eventDetails.getExpirationDate()).isEqualTo("2050-01-01"); assertThat(eventDetails.getError()).isEqualTo(DATE_REQUEST_IN_FUTURE); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationRequestBody eliminationRequestBody = loadRequestJsonFromWorkspace(handler); ItemStatus itemStatus = process(eliminationRequestBody, param, handler); LOGGER.info("Elimination action unit preparation succeeded"); return itemStatus; } catch (ProcessingStatusException e) { LOGGER.error("Elimination action unit preparation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ACTION_UNIT_PREPARATION, e.getStatusCode(), e.getEventDetails()); } }
EliminationActionUnitPreparationHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationRequestBody eliminationRequestBody = loadRequestJsonFromWorkspace(handler); ItemStatus itemStatus = process(eliminationRequestBody, param, handler); LOGGER.info("Elimination action unit preparation succeeded"); return itemStatus; } catch (ProcessingStatusException e) { LOGGER.error("Elimination action unit preparation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ACTION_UNIT_PREPARATION, e.getStatusCode(), e.getEventDetails()); } } }
EliminationActionUnitPreparationHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationRequestBody eliminationRequestBody = loadRequestJsonFromWorkspace(handler); ItemStatus itemStatus = process(eliminationRequestBody, param, handler); LOGGER.info("Elimination action unit preparation succeeded"); return itemStatus; } catch (ProcessingStatusException e) { LOGGER.error("Elimination action unit preparation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ACTION_UNIT_PREPARATION, e.getStatusCode(), e.getEventDetails()); } } EliminationActionUnitPreparationHandler(); @VisibleForTesting  EliminationActionUnitPreparationHandler(
        MetaDataClientFactory metaDataClientFactory,
        EliminationAnalysisService eliminationAnalysisService,
        EliminationActionReportService eliminationActionReportService); }
EliminationActionUnitPreparationHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationRequestBody eliminationRequestBody = loadRequestJsonFromWorkspace(handler); ItemStatus itemStatus = process(eliminationRequestBody, param, handler); LOGGER.info("Elimination action unit preparation succeeded"); return itemStatus; } catch (ProcessingStatusException e) { LOGGER.error("Elimination action unit preparation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ACTION_UNIT_PREPARATION, e.getStatusCode(), e.getEventDetails()); } } EliminationActionUnitPreparationHandler(); @VisibleForTesting  EliminationActionUnitPreparationHandler(
        MetaDataClientFactory metaDataClientFactory,
        EliminationAnalysisService eliminationAnalysisService,
        EliminationActionReportService eliminationActionReportService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId(); }
EliminationActionUnitPreparationHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { EliminationRequestBody eliminationRequestBody = loadRequestJsonFromWorkspace(handler); ItemStatus itemStatus = process(eliminationRequestBody, param, handler); LOGGER.info("Elimination action unit preparation succeeded"); return itemStatus; } catch (ProcessingStatusException e) { LOGGER.error("Elimination action unit preparation failed with status [" + e.getStatusCode() + "]", e); return buildItemStatus(ELIMINATION_ACTION_UNIT_PREPARATION, e.getStatusCode(), e.getEventDetails()); } } EliminationActionUnitPreparationHandler(); @VisibleForTesting  EliminationActionUnitPreparationHandler(
        MetaDataClientFactory metaDataClientFactory,
        EliminationAnalysisService eliminationAnalysisService,
        EliminationActionReportService eliminationActionReportService); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static String getId();  }