@Test public void executeActionTestFailed() { AbstractSimpleDecisionAction.Transition transition; when(wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null)) .thenReturn(ReturnStatus.PAYMENT_REVERSAL_FAILED); transition = wirecardCaptureRefundAction.executeAction(returnProcessModel); assertEquals("The transition should return NOK", AbstractSimpleDecisionAction.Transition.NOK, transition); }
@Override public Transition executeAction(final ReturnProcessModel process) { LOG.info(START_MESSAGE); LOG.info(PROCESS_MESSAGE, process.getCode(), getClass().getSimpleName()); Transition result = Transition.NOK; final ReturnRequestModel returnRequestModel = process.getReturnRequest(); ReturnStatus returnStatus = wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null); if (ReturnStatus.PAYMENT_REVERSED.getCode().equals(returnStatus.getCode())) { result = Transition.OK; } LOG.info(STATUS_MESSAGE, returnRequestModel.getCode(), returnStatus.getCode()); return result; }
WirecardCaptureRefundAction extends AbstractSimpleDecisionAction<ReturnProcessModel> { @Override public Transition executeAction(final ReturnProcessModel process) { LOG.info(START_MESSAGE); LOG.info(PROCESS_MESSAGE, process.getCode(), getClass().getSimpleName()); Transition result = Transition.NOK; final ReturnRequestModel returnRequestModel = process.getReturnRequest(); ReturnStatus returnStatus = wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null); if (ReturnStatus.PAYMENT_REVERSED.getCode().equals(returnStatus.getCode())) { result = Transition.OK; } LOG.info(STATUS_MESSAGE, returnRequestModel.getCode(), returnStatus.getCode()); return result; } }
WirecardCaptureRefundAction extends AbstractSimpleDecisionAction<ReturnProcessModel> { @Override public Transition executeAction(final ReturnProcessModel process) { LOG.info(START_MESSAGE); LOG.info(PROCESS_MESSAGE, process.getCode(), getClass().getSimpleName()); Transition result = Transition.NOK; final ReturnRequestModel returnRequestModel = process.getReturnRequest(); ReturnStatus returnStatus = wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null); if (ReturnStatus.PAYMENT_REVERSED.getCode().equals(returnStatus.getCode())) { result = Transition.OK; } LOG.info(STATUS_MESSAGE, returnRequestModel.getCode(), returnStatus.getCode()); return result; }  }
WirecardCaptureRefundAction extends AbstractSimpleDecisionAction<ReturnProcessModel> { @Override public Transition executeAction(final ReturnProcessModel process) { LOG.info(START_MESSAGE); LOG.info(PROCESS_MESSAGE, process.getCode(), getClass().getSimpleName()); Transition result = Transition.NOK; final ReturnRequestModel returnRequestModel = process.getReturnRequest(); ReturnStatus returnStatus = wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null); if (ReturnStatus.PAYMENT_REVERSED.getCode().equals(returnStatus.getCode())) { result = Transition.OK; } LOG.info(STATUS_MESSAGE, returnRequestModel.getCode(), returnStatus.getCode()); return result; }  @Override Transition executeAction(final ReturnProcessModel process); @Required void setWirecardPOExecutionService(WirecardPOExecutionService wirecardPOExecutionService); }
WirecardCaptureRefundAction extends AbstractSimpleDecisionAction<ReturnProcessModel> { @Override public Transition executeAction(final ReturnProcessModel process) { LOG.info(START_MESSAGE); LOG.info(PROCESS_MESSAGE, process.getCode(), getClass().getSimpleName()); Transition result = Transition.NOK; final ReturnRequestModel returnRequestModel = process.getReturnRequest(); ReturnStatus returnStatus = wirecardPOExecutionService.executePaymentRefundOperation(returnRequestModel, null); if (ReturnStatus.PAYMENT_REVERSED.getCode().equals(returnStatus.getCode())) { result = Transition.OK; } LOG.info(STATUS_MESSAGE, returnRequestModel.getCode(), returnStatus.getCode()); return result; }  @Override Transition executeAction(final ReturnProcessModel process); @Required void setWirecardPOExecutionService(WirecardPOExecutionService wirecardPOExecutionService);  }