Jul 25th, 2006, 09:24 AM
Couldn't find a section for the Mock objects so I will post the problem here.
Sorry for any inconveniences.
I think I found two problems with the MockHttpServletRequest implementation, but they seem so obvious that I think I might be doing soemthing wrong :-)
The first problem is that the getHeader isn't case-insensitive:
MockHttpServletRequest request = new MockHttpServletRequest();
assertEquals("value1", request.getHeader("header")); // this test fails
The second one is that if you add more values to the same header the getHeader should return just the first value, you should get access to the other values by getHeaders.
assertEquals("value1", request.getHeader("Header")); // getHeader returns value1,value2
As I said they seem to be bugs but it it is so I can't believe nobody noticed it before.
Jul 25th, 2006, 11:11 AM
I've just checked the code, they seem to be bugs.
I raised two bugs in JIRA.