Example usage for org.springframework.mock.web MockHttpServletRequest isSecure

List of usage examples for org.springframework.mock.web MockHttpServletRequest isSecure

Introduction

In this page you can find the example usage for org.springframework.mock.web MockHttpServletRequest isSecure.

Prototype

@Override
public boolean isSecure() 

Source Link

Document

Return true if the #setSecure secure flag has been set to true or if the #getScheme scheme is https .

Usage

From source file:org.cateproject.test.functional.mockmvc.HtmlUnitRequestBuilder.java

private com.gargoylesoftware.htmlunit.util.Cookie createCookie(MockHttpServletRequest request,
        String sessionid) {// w w w  .j  a  v  a2s .  c  o  m
    return new com.gargoylesoftware.htmlunit.util.Cookie(request.getServerName(), "JSESSIONID", sessionid,
            request.getContextPath() + "/", null, request.isSecure(), true);
}

From source file:org.osaf.cosmo.BaseMockServletTestCase.java

/** */
protected String toAbsoluteUrl(MockHttpServletRequest request, String path) {
    StringBuffer url = new StringBuffer(request.getScheme());
    url.append("://").append(request.getServerName());
    if ((request.isSecure() && request.getServerPort() != 443) || (request.getServerPort() != 80)) {
        url.append(":").append(request.getServerPort());
    }/*from   w w w . j  av a  2s  .com*/
    if (!request.getContextPath().equals("/")) {
        url.append(request.getContextPath());
    }
    url.append(path);
    return url.toString();
}