Examples of IRequestCycle


Examples of org.apache.wicket.request.IRequestCycle

    Mockito.when(httpRequest.getQueryString()).thenReturn(httpsUrl.getQuery());

    final Url url = Url.parse(httpsUrl.getPath() + "?" + httpsUrl.getQuery());
    final ServletWebRequest webRequest = new ServletWebRequest(httpRequest, "", url);

    final IRequestCycle requestCycle = Mockito.mock(IRequestCycle.class);
    Mockito.when(requestCycle.getRequest()).thenReturn(webRequest);

    HttpsConfig httpsConfig = new HttpsConfig(80, 1443);

    // request secure communication (over https)
    final SwitchProtocolRequestHandler handler = new SwitchProtocolRequestHandler(
      Protocol.HTTPS, httpsConfig);

    final WebResponse webResponse = Mockito.mock(WebResponse.class);
    Mockito.when(requestCycle.getResponse()).thenReturn(webResponse);

    handler.respond(requestCycle);

    Mockito.verify(webResponse).sendRedirect(httpsUrl.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.