WorldpayChoosePaymentMethodCheckoutStepController extends AbstractWorldpayPaymentMethodCheckoutStepController { @Override @RequestMapping(method = GET, value = {"", "/", "/add-cse-payment-details", "/add-payment-details"}) @RequireHardLogIn @PreValidateCheckoutStep(checkoutStep = CHOOSE_PAYMENT_METHOD) public String enterStep(final Model model, final RedirectAttributes redirectAttributes) throws CMSItemNotFoundException { getCheckoutFacade().setDeliveryModeIfAvailable(); if (model.asMap().get(PAYMENT_STATUS_PARAMETER_NAME) != null) { GlobalMessages.addErrorMessage(model, CHECKOUT_MULTI_WORLD_PAY_DECLINED_MESSAGE_DEFAULT); } setupAddPaymentPage(model); setupPaymentDetailsForm(model); setCheckoutStepLinksForModel(model, getCheckoutStep()); return getViewForPage(model); }  @Override @RequestMapping(method = GET, value = {"", "/", "/add-cse-payment-details", "/add-payment-details"}) @RequireHardLogIn @PreValidateCheckoutStep(checkoutStep = CHOOSE_PAYMENT_METHOD) String enterStep(final Model model, final RedirectAttributes redirectAttributes); @RequestMapping(value = "/getDeclineMessage", method = GET) @ResponseBody String getDeclineMessage(); @RequestMapping(value = "/choose", method = GET) @RequireHardLogIn String doSelectPaymentMethod(@RequestParam("selectedPaymentMethodId") final String selectedPaymentMethodId); @ModelAttribute(value = "getTermsAndConditionsUrl") String getTermsAndConditionsUrl(final HttpServletRequest request); @RequestMapping(value = "/remove", method = POST) @RequireHardLogIn String remove(@RequestParam(value = "paymentInfoId") final String paymentMethodId,
                         final RedirectAttributes redirectAttributes); @RequestMapping(value = "/back", method = GET) @RequireHardLogIn @Override String back(final RedirectAttributes redirectAttributes); @RequestMapping(value = "/next", method = GET) @RequireHardLogIn @Override String next(final RedirectAttributes redirectAttributes); String getRedirectToPaymentMethod(); PaymentDetailsFormValidator getPaymentDetailsFormValidator(); MessageSource getThemeSource();  }
@Test public void shouldAddErrorWhenThereIsAPaymentStatusInTheModel() throws CMSItemNotFoundException { when(modelMock.asMap().get(PAYMENT_STATUS_PARAMETER_NAME)).thenReturn(PAYMENT_STATUS); testObj.enterStep(modelMock, redirectAttrsMock); verify(modelMock).addAttribute(eq(ERROR_MESSAGES_HOLDER), any()); }