In brief, the MockServletRequest and MockServletResponse cannot handle a cookie of name=value . They require name=value; (optionalattribute). Without the semi-colon, MockCookie.parse(), introduced in Spring 5.1 RC2 throws an ArrayIndexOutOfBoundsException.
@Test(expected = ArrayIndexOutOfBoundsException.class)
// Demonstrates Spring can't handle thisMockCookie.parse("a=1");
// Demonstrates Spring test needs an attributeMockCookie.parse("a=1; HttpOnly");
// Demonstrates Spring test needs an attributeMockCookie.parse("a=1;");
Regression was introduced in the work discussed in #21647.
Affects: 5.1 GA
#21647 Add support for adding cookies as headers in MockHttpServletResponse
The text was updated successfully, but these errors were encountered: