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
Fixes #1967: Correctly handle mocks with limited life-cycle in listeners. #1968
Conversation
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.
It's not clear to me how the test reproduces the issue as reported in #1967 Can we instead copy the code as reported in the issue and add that to our test suite?
It only tests part of the issue. For actually testing it, we would need to run the JUnit tests with the inline mock maker and create subprojects for it. I am going on a two week vacation tomorrow, so I did not want to open that barrel of wine tonight but I validated the working manually. If you have some time, could you add additional subprojects? I validated the runners manually, however. |
Ah okay. I got confused as the commit mentions that the issue is fixed, so that's why I thought we had test the whole scenario. Please go on vacation, we can figure it out later 😄 |
Codecov Report
@@ Coverage Diff @@
## release/3.x #1968 +/- ##
=================================================
+ Coverage 85.28% 85.30% +0.01%
- Complexity 2591 2594 +3
=================================================
Files 322 322
Lines 7483 7492 +9
Branches 892 895 +3
=================================================
+ Hits 6382 6391 +9
Misses 862 862
Partials 239 239
Continue to review full report at Codecov.
|
I added an additional project for the JUnit Jupiter extension and added a JUnit rule for the inline mock maker tests. I hope this should avoid any future regressions. |
In Mocktio 3.4.0, static mocks causes NotAMockException. They are fixed in 3.4.2. [1] : mockito/mockito#1968 [2]: mockito/mockito#1967
* Fixed test cases of MySQLDataSourcePreparer (Git issue : 14246) * Changed the mockito version to 3.4.2 (Git issue : 14246) In Mocktio 3.4.0, static mocks causes NotAMockException. They are fixed in 3.4.2. [1] : mockito/mockito#1968 [2]: mockito/mockito#1967 * Fixed test MySQLDataSourcePreparerTest (Git issue : 14246)
Due to the limited lifetime of static mocks, they cannot be validated within a Mockito session since they might have expired when the validation is applied. This patch excludes static mocks from all validation. To support static mocks in the regular session validation, we would rather need to trigger the validation upon release of any static mock.