Sorry for dropping here unexpected, @basil shared a small challenge after a presentation for participants to identify the cause of this test failure, and here I am :smile:
BREAKING CHANGE: This changes the default behaviour of the any() matcher, argument captors and MockitoHamcrest matchers when passed to a varargs parameter. Previously, these matcher would match each element in the varargs parameter, matching any number of elements 0...n. From Mockito v5 onwards, 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 the matcher. For example, given a String... varargs parameter, use any(String[].class).
You had the right idea @timja when updating the code to use any(Class[].class), a small update was just missing a few lines above.
I reproduced the test failure locally, and can confirm that the change I'm proposing is fixing the tests.
Let me know if anything else is missing in that PR :smile:
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[x] Ensure that the pull request title represents the desired changelog entry
[x] Please describe what you did
[ ] Link to relevant issues in GitHub or Jira
[x] Link to relevant pull requests, esp. upstream and downstream changes
[x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Hello :wave:
Sorry for dropping here unexpected, @basil shared a small challenge after a presentation for participants to identify the cause of this test failure, and here I am :smile:
The test failure was caused by https://github.com/mockito/mockito/commit/064fe9028993a11ccf0ae12b5975b96baffcf305 which introduces a breaking change related to how varargs are managed:
You had the right idea @timja when updating the code to use
any(Class[].class)
, a small update was just missing a few lines above.I reproduced the test failure locally, and can confirm that the change I'm proposing is fixing the tests.
Let me know if anything else is missing in that PR :smile: