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

Revisit HttpHeadersAssert API with more header-focused assertions #34168

Closed
simonbasle opened this issue Dec 27, 2024 · 3 comments
Closed

Revisit HttpHeadersAssert API with more header-focused assertions #34168

simonbasle opened this issue Dec 27, 2024 · 3 comments
Assignees
Labels
in: test Issues in the test module type: task A general task
Milestone

Comments

@simonbasle
Copy link
Contributor

In 6.2.x, HttpHeadersAssert inherited AbstractMapAssert assertions. Since 7.0, HttpHeaders is no longer a Map and we should take that as an opportunity to introduce more header-focused assertions (potentially inspired by the Map ones).

In #33913, we already introduced the following:

  • containsOnlyHeaders
  • hasExactlyValues
  • hasExactlyValuesInAnyOrder

Some assertions that were ported over in #33913 might not be that relevant and should be re-evaluated as part of this effort:

  • size assertions between/lesser/greater
  • ...
@simonbasle simonbasle added in: test Issues in the test module type: enhancement A general enhancement labels Dec 27, 2024
@simonbasle simonbasle added this to the 7.0.0-M1 milestone Dec 27, 2024
@simonbasle simonbasle self-assigned this Dec 27, 2024
@simonbasle simonbasle changed the title Revisit HttpHeadersAssert API for a more header-focused experience Revisit HttpHeadersAssert API with more header-focused assertions Dec 27, 2024
@snicoll
Copy link
Member

snicoll commented Jan 9, 2025

I can see that hasEntrySatisfying is gone. I think it would be helpful to be able to run assertions on the value(s) of a header based on its name.

@sdeleuze sdeleuze modified the milestones: 7.0.0-M1, 7.0.0-M2 Jan 14, 2025
@simonbasle
Copy link
Contributor Author

simonbasle commented Jan 14, 2025

An hasEntrySatisfying-like assertion would indeed be useful 👍

the current work is available at main...simonbasle:spring-framework:gh-34168

@snicoll snicoll self-assigned this Jan 15, 2025
@snicoll snicoll modified the milestones: 7.0.0-M2, 7.0.0-M1 Jan 15, 2025
@snicoll snicoll added type: task A general task and removed type: enhancement A general enhancement labels Jan 15, 2025
@snicoll
Copy link
Member

snicoll commented Jan 15, 2025

Moved to task as the changes mentioned above were not released yet so this a follow-up of the original enhancement.

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 type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants