-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement
Milestone
Description
Sam Brannen opened SPR-13168 and commented
Status Quo
When rendering cookies via andDo(print()) in Spring MVC Test, the output for the MockHttpServletResponse looks something like the following:
Cookies = [javax.servlet.http.Cookie@3ccd3277]
The reason is that Cookie in javax.servlet-api-3.0.1.jar does not implement toString(). Consequently, nothing about the cookie's name, value, etc., is displayed, thereby making the debug output for cookies next to useless.
Deliverables
- Implement custom
toString()logic inPrintingResultHandlerfor Cookies.
Before
MockHttpServletResponse:
...
Cookies = [javax.servlet.http.Cookie@25084a1e]
After
MockHttpServletResponse:
...
Cookies = [[Cookie@47faa49c name = 'enigma', value = '42', comment = [null], domain = [null], maxAge = -1, path = [null], secure = false, version = 0, httpOnly = false]]
Affects: 3.2 GA
Issue Links:
- Spring MVC Test framework never stores more than one cookie [SPR-13166] #17757 Spring MVC Test framework never stores more than one cookie
- Improve documentation on limitations of Spring MVC Test [SPR-13169] #17760 Improve documentation on limitations of Spring MVC Test
Referenced from: commits 895d43a
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement