Overview
Servlet API 6.0 introduced jakarta.servlet.http.Cookie.getAttribute(String) for accessing attributes other than the standard attributes such as Max-Age, Secure, etc.
However, there is currently no way to assert the values of such attributes in MockMvc. For example, you cannot assert the value of the SameSite attribute.
In contrast, org.springframework.test.web.reactive.server.CookieAssertions.sameSite(String, String) provides first-class support for asserting against the SameSite attribute when using WebTestClient.
Related Issues
Deliverables
Overview
Servlet API 6.0 introduced
jakarta.servlet.http.Cookie.getAttribute(String)for accessing attributes other than the standard attributes such asMax-Age,Secure, etc.However, there is currently no way to assert the values of such attributes in MockMvc. For example, you cannot assert the value of the
SameSiteattribute.In contrast,
org.springframework.test.web.reactive.server.CookieAssertions.sameSite(String, String)provides first-class support for asserting against theSameSiteattribute when usingWebTestClient.Related Issues
SameSitecookie attribute inMockMvcHttpConnector#30264Deliverables
Cookieattributes inCookieResultMatchersforMockMvc.SameSitecookie attribute.CookieResultMatchersDsl.kt