WorldpayCseCheckoutStepController extends AbstractWorldpayDirectCheckoutStepController { @GetMapping(value = "/DDCIframe") @RequireHardLogIn public String getDDCIframeContent(final Model model) { setDDCIframeData(model); return worldpayAddonEndpointService.getDdcIframe3dSecureFlex(); }  @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 shouldPopulate3DSecureJsonWebToken() { when(worldpayDDCFacadeMock.createJsonWebTokenForDDC()).thenReturn(THREEDSFLEX_JSON_WEB_TOKEN_VALUE); when(worldpayDDCFacadeMock.getEventOriginDomainForDDC()).thenReturn(THREEDSFLEX_EVENT_ORIGIN_DOMAIN_VALUE); when(worldpayAddonEndpointServiceMock.getDdcIframe3dSecureFlex()).thenReturn(THREDSFLEX_DDC_PAGE); when(worldpayMerchantConfigDataMock.getThreeDSFlexJsonWebTokenSettings().getDdcUrl()).thenReturn(THREEDSECURE_FLEX_DDC_URL_VALUE); final String result = testObj.getDDCIframeContent(modelMock); verify(modelMock).addAttribute(THREEDSECURE_JWT_FLEX_DDC, THREEDSFLEX_JSON_WEB_TOKEN_VALUE); verify(modelMock).addAttribute(THREEDSECURE_FLEX_DDC_URL, THREEDSECURE_FLEX_DDC_URL_VALUE); assertThat(result).isEqualTo(THREDSFLEX_DDC_PAGE); }