WorldpayCseCheckoutStepController extends AbstractWorldpayDirectCheckoutStepController { @Override protected String getErrorView(final Model model) throws CMSItemNotFoundException { setupAddPaymentPage(model); return worldpayAddonEndpointService.getCSEPaymentDetailsPage(); }  @RequestMapping(value = {"/cse-data", "/place-order"}, method = GET) @RequireHardLogIn String getCseDataPage(final Model model); @RequestMapping(value = "/add-payment-address", method = POST) @RequireHardLogIn String addPaymentAddress(final Model model, @Valid final PaymentDetailsForm paymentDetailsForm, final BindingResult bindingResult, final RedirectAttributes redirectAttrs); @RequestMapping(value = "/place-order", method = POST) @RequireHardLogIn String addCseData(final HttpServletRequest request, final Model model, @Valid final CSEPaymentForm csePaymentForm, final BindingResult bindingResult, final HttpServletResponse response); @GetMapping(value = "/DDCIframe") @RequireHardLogIn String getDDCIframeContent(final Model model); @GetMapping(value = "/challengeIframe") @RequireHardLogIn String getChallengeIframeContent(final Model model);  }
@Test public void shouldPopulateCSEPublicKeyForCseErrorsPage() throws CMSItemNotFoundException { when(worldpayMerchantConfigDataMock.getCsePublicKey()).thenReturn(CSE_PUBLIC_KEY_VALUE); testObj.getErrorView(modelMock); verify(modelMock).addAttribute(CSE_PUBLIC_KEY, CSE_PUBLIC_KEY_VALUE); }