01: package org.acegisecurity.ui.savedrequest;
02:
03: import junit.framework.TestCase;
04: import org.acegisecurity.MockPortResolver;
05: import org.springframework.mock.web.MockHttpServletRequest;
06:
07: public class SavedRequestTests extends TestCase {
08:
09: public void testCaseInsensitveHeaders() throws Exception {
10: MockHttpServletRequest request = new MockHttpServletRequest();
11: request.addHeader("USER-aGenT", "Mozilla");
12: SavedRequest saved = new SavedRequest(request,
13: new MockPortResolver(8080, 8443));
14: assertEquals("Mozilla", saved.getHeaderValues("user-agent")
15: .next());
16: }
17:
18: public void testCaseInsensitveParameters() throws Exception {
19: MockHttpServletRequest request = new MockHttpServletRequest();
20: request.addParameter("ThisIsATest", "Hi mom");
21: SavedRequest saved = new SavedRequest(request,
22: new MockPortResolver(8080, 8443));
23: assertEquals("Hi mom",
24: saved.getParameterValues("thisisatest")[0]);
25: }
26: }
|