@Test public void placeOrderShouldScheduleReplenishment() throws InvalidCartException { PlaceOrderData placeOrderData = createPlaceOrderData(true); mockPayByCard(); Mockito.when(triggerModelMock.getRelative()).thenReturn(Boolean.TRUE); testObj.placeOrder(placeOrderData); Mockito.verify(b2BAcceleratorCheckoutFacade, Mockito.times(1)).scheduleOrder(Matchers.any()); }
@Override public <T extends AbstractOrderData> T placeOrder(PlaceOrderData placeOrderData) throws InvalidCartException { if (!placeOrderData.getTermsCheck().equals(Boolean.TRUE)) { throw new EntityValidationException(getLocalizedString(CART_CHECKOUT_TERM_UNCHECKED)); } isAuthorisedNow(placeOrderData); if (isValidCheckoutCart(placeOrderData)) { if (placeOrderData.getReplenishmentOrder() != null && placeOrderData.getReplenishmentOrder().equals(Boolean.TRUE)) { return handleReplenishment(placeOrderData); } return (T) b2BAcceleratorCheckoutFacade.placeOrder(); } return null; }
WorldpayB2BAcceleratorCheckoutFacadeDecorator extends DefaultB2BAcceleratorCheckoutFacade { @Override public <T extends AbstractOrderData> T placeOrder(PlaceOrderData placeOrderData) throws InvalidCartException { if (!placeOrderData.getTermsCheck().equals(Boolean.TRUE)) { throw new EntityValidationException(getLocalizedString(CART_CHECKOUT_TERM_UNCHECKED)); } isAuthorisedNow(placeOrderData); if (isValidCheckoutCart(placeOrderData)) { if (placeOrderData.getReplenishmentOrder() != null && placeOrderData.getReplenishmentOrder().equals(Boolean.TRUE)) { return handleReplenishment(placeOrderData); } return (T) b2BAcceleratorCheckoutFacade.placeOrder(); } return null; } }
WorldpayB2BAcceleratorCheckoutFacadeDecorator extends DefaultB2BAcceleratorCheckoutFacade { @Override public <T extends AbstractOrderData> T placeOrder(PlaceOrderData placeOrderData) throws InvalidCartException { if (!placeOrderData.getTermsCheck().equals(Boolean.TRUE)) { throw new EntityValidationException(getLocalizedString(CART_CHECKOUT_TERM_UNCHECKED)); } isAuthorisedNow(placeOrderData); if (isValidCheckoutCart(placeOrderData)) { if (placeOrderData.getReplenishmentOrder() != null && placeOrderData.getReplenishmentOrder().equals(Boolean.TRUE)) { return handleReplenishment(placeOrderData); } return (T) b2BAcceleratorCheckoutFacade.placeOrder(); } return null; }  }
WorldpayB2BAcceleratorCheckoutFacadeDecorator extends DefaultB2BAcceleratorCheckoutFacade { @Override public <T extends AbstractOrderData> T placeOrder(PlaceOrderData placeOrderData) throws InvalidCartException { if (!placeOrderData.getTermsCheck().equals(Boolean.TRUE)) { throw new EntityValidationException(getLocalizedString(CART_CHECKOUT_TERM_UNCHECKED)); } isAuthorisedNow(placeOrderData); if (isValidCheckoutCart(placeOrderData)) { if (placeOrderData.getReplenishmentOrder() != null && placeOrderData.getReplenishmentOrder().equals(Boolean.TRUE)) { return handleReplenishment(placeOrderData); } return (T) b2BAcceleratorCheckoutFacade.placeOrder(); } return null; }  @Override T placeOrder(PlaceOrderData placeOrderData); @Required void setL10NService(final L10NService l10NService); @Required void setB2BAcceleratorCheckoutFacade(DefaultB2BAcceleratorCheckoutFacade b2BAcceleratorCheckoutFacade); }
WorldpayB2BAcceleratorCheckoutFacadeDecorator extends DefaultB2BAcceleratorCheckoutFacade { @Override public <T extends AbstractOrderData> T placeOrder(PlaceOrderData placeOrderData) throws InvalidCartException { if (!placeOrderData.getTermsCheck().equals(Boolean.TRUE)) { throw new EntityValidationException(getLocalizedString(CART_CHECKOUT_TERM_UNCHECKED)); } isAuthorisedNow(placeOrderData); if (isValidCheckoutCart(placeOrderData)) { if (placeOrderData.getReplenishmentOrder() != null && placeOrderData.getReplenishmentOrder().equals(Boolean.TRUE)) { return handleReplenishment(placeOrderData); } return (T) b2BAcceleratorCheckoutFacade.placeOrder(); } return null; }  @Override T placeOrder(PlaceOrderData placeOrderData); @Required void setL10NService(final L10NService l10NService); @Required void setB2BAcceleratorCheckoutFacade(DefaultB2BAcceleratorCheckoutFacade b2BAcceleratorCheckoutFacade);  }