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

Make sure interface types are initialized before inline mocking to avoid blocking code of static initializers. #2505

Merged
merged 1 commit into from Dec 12, 2021

Conversation

raphw
Copy link
Member

@raphw raphw commented Dec 10, 2021

Fixes #2499

There was no explicit initialization of subinterfaces which can of course also declare initializers. Those were not executed at the right time and broke the mocking.

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #2505 (4635780) into main (dbcbb3f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #2505   +/-   ##
=========================================
  Coverage     86.53%   86.53%           
  Complexity     2779     2779           
=========================================
  Files           320      320           
  Lines          8341     8342    +1     
  Branches       1022     1022           
=========================================
+ Hits           7218     7219    +1     
  Misses          851      851           
  Partials        272      272           
Impacted Files Coverage Δ
...al/creation/bytebuddy/InlineBytecodeGenerator.java 84.05% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbcbb3f...4635780. Read the comment docs.

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a small regression test for this? The bug contains a small test case that we can hopefully copy?

@raphw
Copy link
Member Author

raphw commented Dec 10, 2021

Good point, I stripped it to the minimum and merged it into a single test to avoid that the tests are run out of order.

@raphw raphw force-pushed the initialize-interfaces branch 2 times, most recently from 73c77c2 to 41557b8 Compare December 10, 2021 21:50
Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obscure issue with mockito-inline: mock object in a test seems to be corrupting mock in later test
3 participants