DefaultWorldpayHostedOrderFacade implements WorldpayHostedOrderFacade { @Override public void completeRedirectAuthorise(final RedirectAuthoriseResult result) { String merchantCode = sessionService.getAttribute(WORLDPAY_MERCHANT_CODE); if (Objects.isNull(merchantCode)) { merchantCode = worldpayMerchantConfigDataFacade.getCurrentSiteMerchantConfigData().getCode(); } final CartModel cart = cartService.getSessionCart(); worldpayRedirectOrderService.completePendingRedirectAuthorise(result, merchantCode, cart); } DefaultWorldpayHostedOrderFacade(final SessionService sessionService, final WorldpayRedirectOrderService worldpayRedirectOrderService,
                                            final WorldpayMerchantInfoService worldpayMerchantInfoService, final CartService cartService,
                                            final WorldpayOrderInfoStrategy worldpayOrderInfoStrategy,
                                            final WorldpayMerchantConfigDataFacade worldpayMerchantConfigDataFacade,
                                            final OrderInquiryService orderInquiryService,
                                            final APMConfigurationLookupService apmConfigurationLookupService,
                                            final WorldpayOrderService worldpayOrderService); @Override PaymentData redirectAuthorise(final AdditionalAuthInfo additionalAuthInfo); @Override void completeRedirectAuthorise(final RedirectAuthoriseResult result); @Override boolean validateRedirectResponse(final Map<String, String> worldpayResponse); @Override RedirectAuthoriseResult inquiryPaymentStatus();  }
@Test public void shouldCompleteRedirect() { testObj.completeRedirectAuthorise(redirectAuthoriseResultMock); verify(worldpayRedirectOrderServiceMock).completePendingRedirectAuthorise(redirectAuthoriseResultMock, MERCHANT_CODE, cartModelMock); }