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 - ...
Comment From: snicoll
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.
Comment From: simonbasle
An hasEntrySatisfying
-like assertion would indeed be useful 👍
the current work is available at https://github.com/spring-projects/spring-framework/compare/main...simonbasle:spring-framework:gh-34168
Comment From: snicoll
Moved to task as the changes mentioned above were not released yet so this a follow-up of the original enhancement.