-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fixes #974: Fix to get correct stubbing location with inline mocking #979
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
Conversation
Codecov Report
@@ Coverage Diff @@
## release/2.x #979 +/- ##
=================================================
+ Coverage 86.8% 86.82% +0.01%
- Complexity 2275 2281 +6
=================================================
Files 287 287
Lines 5769 5783 +14
Branches 675 677 +2
=================================================
+ Hits 5008 5021 +13
Misses 571 571
- Partials 190 191 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice change, deep in the internals of Mockito. Thank you very much for fixing it!!!
I feel that it would be cleaner if we could put this logic in the StackTraceCleaner implementation somehow. StackTraceCleaner is a public API and we cannot just change it. Given that we don't need to change this code often I'm ok with a little bit overlap between cleaner and filter.
Can you describe how did you test this change? (does the unstubbed method finder work ok now, does filtering work ok in general - verification errors).
Approved. Thanks again!
To solve the issue #974, I thought that if one stack trace element is the method frame representation of
I ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes seems fine, the refactoring of the ClassMethodPair made it a bit hard to review. In the future, if you can do without such an unrelated refactor, please do. It is easier to review 2 separate pull requests than 1 big one :P
In the tests I don't see a usage of the inline mockmaker. Per #752 this might not be tested. Could you explicitly try it with the inline mockmaker?
Also I would like @raph to sign of this change, but he is fairly busy right now. Thanks for your patience!
@TimvdLippe, thank you for your review. I did not know that mock maker can be switched by environmental variables. |
I've just updated. I ran the following command on release/2.x and this PR.
On release/2.x (log):
On this PR (log):
The same tests failed. In the previous code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me. I would like to have @raphw sign this of as well before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the fix.
This PR fixes #974.