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

Wrong MockRestRequestMatchers.header() method in spring-test being invoked (JDK issue?) #30235

Closed
github-actions bot opened this issue Mar 30, 2023 · 1 comment
Assignees
Labels
type: backport An issue that is a backport of another issue to a maintenance branch type: regression A bug that is also a regression
Milestone

Comments

@github-actions
Copy link

Backport of gh-30220

@github-actions github-actions bot added type: backport An issue that is a backport of another issue to a maintenance branch type: regression A bug that is also a regression labels Mar 30, 2023
@github-actions github-actions bot added this to the 5.3.27 milestone Mar 30, 2023
@simonbasle simonbasle self-assigned this Apr 4, 2023
simonbasle added a commit that referenced this issue Apr 4, 2023
This commit changes the name of two recently introduced methods in the
`MockRestRequestMatchers` class for header and queryParam. These have
been 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 both `List`
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.

See gh-30220
See gh-30238
Closes gh-30235
@simonbasle
Copy link
Contributor

Closed by 0cfbf60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: backport An issue that is a backport of another issue to a maintenance branch type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

1 participant