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

Feature request: Unify order of parameters #2173

Closed
bohni opened this issue Jan 12, 2021 · 4 comments · Fixed by #2179
Closed

Feature request: Unify order of parameters #2173

bohni opened this issue Jan 12, 2021 · 4 comments · Fixed by #2179

Comments

@bohni
Copy link
Contributor

bohni commented Jan 12, 2021

Hello,

I just stumbled accross the switched order of the VerificationMode parameter

org.mockito.Mockito.verify(T, VerificationMode)

vs

org.mockito.MockedStatic.verify(VerificationMode, Verification)

Is there a reason, the VerificationMode from MockitoStatic is at first position?

@TimvdLippe
Copy link
Contributor

No, this might be a simple oversight. @raphw I think we can reverse the order? We would need to add an overload and then deprecate the existing one, which we can delete in Mockito 4.0.0.

@raphw
Copy link
Member

raphw commented Jan 15, 2021

No, I don't think I had an intention with the order, possibly to have the lambda last what often works better with languages like Kotlin. But I think consistency is the better goal.

@TimvdLippe
Copy link
Contributor

@bohni Do you mind sending us a PR with the added method + deprecation?

@bohni
Copy link
Contributor Author

bohni commented Jan 16, 2021

OK, I will take a look

TimvdLippe pushed a commit that referenced this issue Jan 16, 2021
For consistency, the parameters of the method
`MockedStatic.verify(VerificationMode, Verification)`
have been swapped to
`MockedStatic.verify(Verification, VerificationMode)`
as this order is already used in
`Mockito.verify(T, VerificationMode)`.

Fixes: #2173

[ci maven-central-release]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants