WorldpayChoosePaymentMethodCheckoutStepController extends AbstractWorldpayPaymentMethodCheckoutStepController { @ModelAttribute(value = "getTermsAndConditionsUrl") public String getTermsAndConditionsUrl(final HttpServletRequest request) { return request.getContextPath() + CHECKOUT_MULTI_TERMS_AND_CONDITIONS; }  @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 shouldReturnTheTermsAndConditionsUrl() { when(httpServletRequestMock.getContextPath()).thenReturn(""); final String termsAndConditions = testObj.getTermsAndConditionsUrl(httpServletRequestMock); assertEquals(CHECKOUT_TERMS_AND_CONDITIONS, termsAndConditions); }