@Test public void executeShouldReturnOK() { when(orderModelMock.getFraudulent()).thenReturn(false); final String result = testObj.execute(orderProcessModelMock); verify(modelServiceMock).save(orderHistoryEntryModelMock); verify(orderModelMock, never()).setStatus(SUSPENDED); verify(orderModelMock).setStatus(FRAUD_CHECKED); verify(modelServiceMock).save(orderModelMock); assertEquals(OK, result); }
@Override public final String execute(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent()) { setOrderStatus(order, OrderStatus.SUSPENDED); removeSavedPaymentInfo(order); return NOK; } setOrderStatus(order, FRAUD_CHECKED); return OK; } return UNDEFINED; }
WorldpayOrderManualCheckedAction extends WorldpayAbstractOrderAction<OrderProcessModel> { @Override public final String execute(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent()) { setOrderStatus(order, OrderStatus.SUSPENDED); removeSavedPaymentInfo(order); return NOK; } setOrderStatus(order, FRAUD_CHECKED); return OK; } return UNDEFINED; } }
WorldpayOrderManualCheckedAction extends WorldpayAbstractOrderAction<OrderProcessModel> { @Override public final String execute(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent()) { setOrderStatus(order, OrderStatus.SUSPENDED); removeSavedPaymentInfo(order); return NOK; } setOrderStatus(order, FRAUD_CHECKED); return OK; } return UNDEFINED; }  }
WorldpayOrderManualCheckedAction extends WorldpayAbstractOrderAction<OrderProcessModel> { @Override public final String execute(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent()) { setOrderStatus(order, OrderStatus.SUSPENDED); removeSavedPaymentInfo(order); return NOK; } setOrderStatus(order, FRAUD_CHECKED); return OK; } return UNDEFINED; }  @Override Set<String> getTransitions(); @Override final String execute(final OrderProcessModel process); }
WorldpayOrderManualCheckedAction extends WorldpayAbstractOrderAction<OrderProcessModel> { @Override public final String execute(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent()) { setOrderStatus(order, OrderStatus.SUSPENDED); removeSavedPaymentInfo(order); return NOK; } setOrderStatus(order, FRAUD_CHECKED); return OK; } return UNDEFINED; }  @Override Set<String> getTransitions(); @Override final String execute(final OrderProcessModel process);  }