Repository navigation
Fixes #2548 : Makes InOrder able to verify static methods - #2549
TimvdLippe merged 3 commits into
Conversation
TimvdLippe
left a comment
There was a problem hiding this comment.
Thanks for the PR! Overall, the implementation looks solid. I only have a couple of nits with regards to the tests.
My only concern is the difference in the class passed into inOrder and the class we are actually interacting with. I guess this currently works, as we are passing in a Class in the List<Object>, but that feels a bit weird to me. Not sure WDYT?
I think to fix that, we would need a similar method to objectIsMockToBeVerified, but in this case verify that the context is correct. However, we are only passing in the lambda, which doesn't necessarily match to the Class we put in.
Therefore, we maybe have to look into passing the mockedStatic in the inOrder method instead and omit it as an argument from the inOrder.verify call?
Thanks for your feedback @TimvdLippe ! I have addressed the comments and pushed the changes related to the tests. I see your concern, and actually, passing the |
Codecov Report
@@ Coverage Diff @@
## main #2549 +/- ##
============================================
+ Coverage 86.71% 86.75% +0.04%
- Complexity 2784 2796 +12
============================================
Files 320 321 +1
Lines 8341 8368 +27
Branches 1021 1024 +3
============================================
+ Hits 7233 7260 +27
Misses 840 840
Partials 268 268
Continue to review full report at Codecov.
|
TimvdLippe
left a comment
There was a problem hiding this comment.
Awesome, thanks for the explanation (makes sense to me) and the nice PR + tests! Merging 🎉
This PR makes it possible to verify static methods calls in order. Fixes: #2548
Example of usage:
You can also pass a specific
VerificationModeas third argument to theInOrder#verifymethod.Checklist
including project members to get a better picture of the change
commit is meaningful and help the people that will explore a change in 2 years
Fixes #<issue number>in the description if relevantFixes #<issue number>if relevant