Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce assertions against Cookie attributes in CookieResultMatchers for MockMvc #30285

Closed
3 tasks done
sbrannen opened this issue Apr 4, 2023 · 0 comments
Closed
3 tasks done
Assignees
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Apr 4, 2023

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
@sbrannen sbrannen added in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Apr 4, 2023
@sbrannen sbrannen added this to the 6.0.x milestone Apr 4, 2023
@simonbasle simonbasle self-assigned this Apr 4, 2023
@simonbasle simonbasle modified the milestones: 6.0.x, 6.0.8 Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants