Skip to content

Introduce assertions against Cookie attributes in CookieResultMatchers for MockMvc #30285

@sbrannen

Description

@sbrannen

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

  • Introduce assertions against Cookie attributes in CookieResultMatchers for MockMvc.
  • Consider introducing a dedicated assertion for the SameSite cookie attribute.
  • Add DSL support in Kotlin in CookieResultMatchersDsl.kt

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions