-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove VarargMatcher
#2835
Merged
TimvdLippe
merged 14 commits into
mockito:main
from
big-andy-coates:remove_vararg_matcher
Dec 30, 2022
Merged
Remove VarargMatcher
#2835
TimvdLippe
merged 14 commits into
mockito:main
from
big-andy-coates:remove_vararg_matcher
Dec 30, 2022
Commits on Dec 23, 2022
-
fixes: mockito#1593 Remove broken `VarargMatcher` internal interface. BREAKING CHANGE: This changes the default behaviour of the `any()` matcher when passed to a varargs parameter. Previously, the `any()` matcher would match each element in the varargs parameter, matching any number of elements 0...n. From Mockito v5 onwards `any()`, when passed to a varargs parameter, will match invocations where a single value is passed to the varargs parameter. To match any number of values passed to the varargs parameter, pass the type of the varargs parameter to `any()`. For example, given a `String...` varargs parameter, use `any(String[].class)`.
Configuration menu - View commit details
-
Copy full SHA for 04b4581 - Browse repository at this point
Copy the full SHA 04b4581View commit details -
...tests duplicate others in `VarargsTest`
Configuration menu - View commit details
-
Copy full SHA for 7fe9688 - Browse repository at this point
Copy the full SHA 7fe9688View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6eb9e6 - Browse repository at this point
Copy the full SHA c6eb9e6View commit details -
BREAKING CHANGE: The behaviour of argument captors when passed to a varargs parameter has changed. Prior to Mockito v5, passing an argument captor to a varargs parameter would capture any number of values passed to the varargs parameter. From Mockito v5, the same call will match only a single value passed to the varargs parameter. To capture any number of values, change to the type of the argument captor to match the array type of the varargs parameter. For example, given a `String...` varargs parameter, change the argument captor from type `String` to type `String[]`.
Configuration menu - View commit details
-
Copy full SHA for 8285f9c - Browse repository at this point
Copy the full SHA 8285f9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1221dd - Browse repository at this point
Copy the full SHA a1221ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 873294f - Browse repository at this point
Copy the full SHA 873294fView commit details -
BREAKING CHANGE: The behaviour of all methods in `MockitoHamcrest` when passed to a varargs parameter has changed. Prior to Mockito v5, these matchers would match each element in the varargs parameter, matching any number of elements 0...n. From Mockito v5 onwards these matchers, when passed to a varargs parameter, will match invocations where a single value is passed to the varargs parameter. To match any number of values passed to the varargs parameter, pass use suitable Matcher that matches the vararg's array type. For example, given a `String...` varargs parameter, use a Matcher that handles `String[].class`.
Configuration menu - View commit details
-
Copy full SHA for 6572d0b - Browse repository at this point
Copy the full SHA 6572d0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a13caf - Browse repository at this point
Copy the full SHA 2a13cafView commit details -
... required to support matchers that match a vararg parameter, rather than values in a varargs parameter.
Configuration menu - View commit details
-
Copy full SHA for 7117387 - Browse repository at this point
Copy the full SHA 7117387View commit details
Commits on Dec 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for eaafc3e - Browse repository at this point
Copy the full SHA eaafc3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17f97a1 - Browse repository at this point
Copy the full SHA 17f97a1View commit details
Commits on Dec 29, 2022
-
...demonstrating how exactly two, or any number, of varargs values can be matched with argument captors.
Configuration menu - View commit details
-
Copy full SHA for fbf8929 - Browse repository at this point
Copy the full SHA fbf8929View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a87dd6 - Browse repository at this point
Copy the full SHA 7a87dd6View commit details
Commits on Dec 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b939591 - Browse repository at this point
Copy the full SHA b939591View commit details
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.