WorldpayCseCheckoutStepController extends AbstractWorldpayDirectCheckoutStepController { protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServletRequest request, final String cvc, final CSEAdditionalAuthInfo cseAdditionalAuthInfo) { final WorldpayAdditionalInfoData worldpayAdditionalInfo = getWorldpayAdditionalInfoFacade().createWorldpayAdditionalInfoData(request); worldpayAdditionalInfo.setSecurityCode(cvc); if (cseAdditionalAuthInfo.getAdditional3DS2() != null) { worldpayAdditionalInfo.setAdditional3DS2(cseAdditionalAuthInfo.getAdditional3DS2()); } return worldpayAdditionalInfo; }  @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 shouldCreateWorldpayAdditionalInfo() { when(worldpayAdditionalInfoFacadeMock.createWorldpayAdditionalInfoData(httpServletRequestMock)).thenReturn(worldpayAdditionalInfoDataMock); when(cseAdditionalAuthInfoMock.getAdditional3DS2()).thenReturn(additional3DS2InfoMock); when(cseAdditionalAuthInfoMock.getAdditional3DS2().getDfReferenceId()).thenReturn(ID_REFERENCE); when(cseAdditionalAuthInfoMock.getAdditional3DS2().getChallengeWindowSize()).thenReturn(WINDOW_SIZE); testObj.createWorldpayAdditionalInfo(httpServletRequestMock, CVC, cseAdditionalAuthInfoMock); verify(worldpayAdditionalInfoFacadeMock).createWorldpayAdditionalInfoData(httpServletRequestMock); verify(worldpayAdditionalInfoDataMock).setSecurityCode(CVC); verify(worldpayAdditionalInfoDataMock).setAdditional3DS2(additional3DS2InfoMock); }