MINOR: Upgrade mockito test dependencies #12460
Merged
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.
Changes
Most important updates:
@MockitoSettings
ignored after upgrade from 4.5.1 to 4.6.0 mockito/mockito#2656Why is this change needed?
Update 1
According to the Mockito documentation :
While working on the Replace EasyMock and PowerMock with Mockito for StreamsMetricsImplTest I noticed that described behavior wasn't applied when you create a new
mock
like this.After further investigation I figured out that described behaviour wasn't implemented until
v4.6.1
.With this change we are now able to mock objects like this:
Update 2
It looks like I can accomplish the same thing by using the
@RunWith(MockitoJUnitRunner.StrictStubs.class)
instead of the@RunWith(MockitoJUnitRunner.class)
so mockito dependency version update is not mandatory, but it would be nice to stay up-to-date and use the latest version (it's up to MR reviewer to decide if we are going to merge this now, or just close the MR and update mockito version later).Committer Checklist (excluded from commit message)