Made parameters case-insensitive

This commit is contained in:
Ray Krueger 2006-09-14 20:47:17 +00:00
parent 6779d97546
commit cf91104b69
1 changed files with 7 additions and 1 deletions

View File

@ -6,11 +6,17 @@ import org.springframework.mock.web.MockHttpServletRequest;
public class SavedRequestTests extends TestCase { public class SavedRequestTests extends TestCase {
public void testCaseInsensitve() throws Exception { public void testCaseInsensitveHeaders() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader("USER-aGenT", "Mozilla"); request.addHeader("USER-aGenT", "Mozilla");
SavedRequest saved = new SavedRequest(request, new MockPortResolver(8080, 8443)); SavedRequest saved = new SavedRequest(request, new MockPortResolver(8080, 8443));
assertEquals("Mozilla", saved.getHeaderValues("user-agent").next()); assertEquals("Mozilla", saved.getHeaderValues("user-agent").next());
} }
public void testCaseInsensitveParameters() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter("ThisIsATest", "Hi mom");
SavedRequest saved = new SavedRequest(request, new MockPortResolver(8080, 8443));
assertEquals("Hi mom", saved.getParameterValues("thisisatest")[0]);
}
} }