Fixes #2201 : Fixed checking of declared exceptions.#2547
Conversation
…hen parent contains throws keyword on its method and child overrides this method removing throws, it should be possible to mock throwing exception from child
Codecov Report
@@ Coverage Diff @@
## main #2547 +/- ##
============================================
- Coverage 86.69% 86.54% -0.16%
- Complexity 2782 2790 +8
============================================
Files 320 320
Lines 8344 8359 +15
Branches 1022 1023 +1
============================================
Hits 7234 7234
- Misses 840 857 +17
+ Partials 270 268 -2
Continue to review full report at Codecov.
|
|
WOW Amazing!! |
TimvdLippe
left a comment
There was a problem hiding this comment.
Thanks for the PR! I think we are nearly there, but there are some more edge cases we need to handle.
0e0e577 to
77f7dbd
Compare
Thank you for the comment. I've extended checking for exceptions and added tests for all the cases you've mentioned |
77f7dbd to
66146e6
Compare
66146e6 to
792da83
Compare
TimvdLippe
left a comment
There was a problem hiding this comment.
Nice work and regression tests, thanks! 🎉
Fixed checking of declared exceptions. In case when parent contains throws keyword on its method and child overrides this method removing throws, it should be possible to mock throwing exception from child
Description.
Lets assume that we have the following interface
And we have class that extends the interface, removing
throwsexceptionWhen we trying to mock exception throw, it wasn't possible
Now this behavior fixed
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