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

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

Introduction

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

Prototype

@Override
    @Nullable
    public String getRequestedSessionId() 

Source Link

Usage

From source file:org.springframework.test.web.servlet.htmlunit.HtmlUnitRequestBuilderTest.java

@Test
public void buildRequestRequestedSessionIdNull() throws Exception {
    MockHttpServletRequest actualRequest = requestBuilder.buildRequest(servletContext);

    assertThat(actualRequest.getRequestedSessionId()).isNull();
}

From source file:org.springframework.test.web.servlet.htmlunit.HtmlUnitRequestBuilderTest.java

@Test
public void buildRequestRequestedSessionId() throws Exception {
    String sessionId = "session-id";
    webRequest.setAdditionalHeader("Cookie", "JSESSIONID=" + sessionId);
    MockHttpServletRequest actualRequest = requestBuilder.buildRequest(servletContext);

    assertThat(actualRequest.getRequestedSessionId()).isEqualTo(sessionId);
}

From source file:org.springframework.test.web.servlet.htmlunit.HtmlUnitRequestBuilderTests.java

@Test
public void buildRequestRequestedSessionIdNull() throws Exception {
    MockHttpServletRequest actualRequest = requestBuilder.buildRequest(servletContext);

    assertThat(actualRequest.getRequestedSessionId(), nullValue());
}

From source file:org.springframework.test.web.servlet.htmlunit.HtmlUnitRequestBuilderTests.java

@Test
public void buildRequestRequestedSessionId() throws Exception {
    String sessionId = "session-id";
    webRequest.setAdditionalHeader("Cookie", "JSESSIONID=" + sessionId);
    MockHttpServletRequest actualRequest = requestBuilder.buildRequest(servletContext);

    assertThat(actualRequest.getRequestedSessionId(), equalTo(sessionId));
}