WorldpayThreeDSecureFlexEndpointController extends AbstractWorldpayDirectCheckoutStepController { @PostMapping(value = "/response") @RequireHardLogIn public String doHandleThreeDSecureResponse(final HttpServletRequest request, final ThreeDSecureFlexForm threeDSecureFlexForm, final RedirectAttributes redirectAttributes) { return REDIRECT_PREFIX + configurationService.getConfiguration().getString(WorldpayapiConstants.WORLDPAY_3DSECURE_FLEX_SECOND_AUTH_SUBMIT_URL); }  @PostMapping(value = "/response") @RequireHardLogIn String doHandleThreeDSecureResponse(final HttpServletRequest request, final ThreeDSecureFlexForm threeDSecureFlexForm, final RedirectAttributes redirectAttributes); @GetMapping(value = "/response/autosubmit") @RequireHardLogIn String getThreeDSecureResponseAutosubmit(final HttpServletRequest request, final ThreeDSecureFlexForm threeDSecureFlexForm, final RedirectAttributes redirectAttributes); @PostMapping(value = "/response/autosubmit") @RequireHardLogIn String doHandleThreeDSecureResponse(final HttpServletRequest request, final Model model, final HttpServletResponse response);  }
@Test public void testDoHandleThreeDSecureResponse() { final String response = testObj.doHandleThreeDSecureResponse(requestMock, threeDSecureFlexFormMock, redirectAttributesMock); assertEquals(REDIRECT_PREFIX + CHECKOUT_MULTI_WORLDPAY_3_DSECUREFLEX_SOP_RESPONSE_AUTOSUBMIT, response); }
@Test public void testDoHandleThreeDSecureResponseThatShouldRedirectToOrderConfirmation() throws CMSItemNotFoundException, WorldpayException, InvalidCartException { doReturn(CHECKOUT_ORDER_CONFIRMATION).when(testObj).handleDirectResponse(modelMock, directResponseDataMock, responseMock); when(worldpayDirectOrderFacadeMock.executeSecondPaymentAuthorisation3DSecure()).thenReturn(directResponseDataMock); final String result = testObj.doHandleThreeDSecureResponse(requestMock, modelMock, responseMock); assertEquals(CHECKOUT_ORDER_CONFIRMATION, result); }