Search in sources :

Example 11 with SavedRequestAwareWrapper

use of org.springframework.security.web.savedrequest.SavedRequestAwareWrapper in project spring-security by spring-projects.

the class SavedRequestAwareWrapperTests method correctIntHeaderIsReturned.

@Test
public void correctIntHeaderIsReturned() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.addHeader("header", "999");
    request.addHeader("header", "1000");
    SavedRequestAwareWrapper wrapper = createWrapper(request, new MockHttpServletRequest());
    assertThat(wrapper.getIntHeader("header")).isEqualTo(999);
    assertThat(wrapper.getIntHeader("nonexistent")).isEqualTo(-1);
}
Also used : SavedRequestAwareWrapper(org.springframework.security.web.savedrequest.SavedRequestAwareWrapper) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)11 SavedRequestAwareWrapper (org.springframework.security.web.savedrequest.SavedRequestAwareWrapper)11 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 Enumeration (java.util.Enumeration)1 Cookie (javax.servlet.http.Cookie)1