Rename MockMVC matcher methods to prevent regression in user tests #30238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit changes the name of two recently introduced methods in the
MockRestRequestMatchers
class for header and queryParam. These havebeen found to cause false negatives in user tests, due to the new
overload taking precedence in some cases.
Namely, using a
Matcher
factory method which can apply to bothList
and
String
will cause the compiler to select the newest list overload,by instantiating a
Matcher<Object>
.This can cause false negatives in user tests, failing tests that used
to pass because the Matcher previously applied to the first String in
the header or queryParam value list. For instance,
equalsTo("a")
.The new overloads are recent enough and this has enough potential to
cause an arbitrary number of user tests to fail that we break the API
to eliminate the ambiguity, by renaming the methods with a
*List
suffix.
Closes gh-30220
Closes gh-30238
See gh-29953
See gh-28660