Skip to content

MockHttpServletRequest returns empty cookies array instead of null if instance is built using MockHttpServletRequestBuilder [SPR-13314] #17899

@spring-projects-issues

Description

@spring-projects-issues

Joan Parera opened SPR-13314 and commented

If a MockHttpServletRequest is built using the MockHttpServletRequestBuilder in Spring MVC Test and no cookies are added, the getCookies() method returns an empty array.

However, according to the Servlet API, an implementation of HttpServletRequest.getCookies() must return null if the request has no cookies.


Affects: 3.2 GA

Referenced from: commits 93c07e7

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions