You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue relates with #1509 for the Mockito Junit 5 extension.
The extension is precious to write maintainable code which automatically creates, injects mocks OOTB and validates that all mocks are correctly used. All of this comes with a price: all of this magic slows down each unit test.
For example, a simple unit test written Junit 5.10.1 with mockito Extension 5.8.0
played via 17.0.9-zulu on Ubuntu 22.04.3 LTS virtualized over Intel i9-10885H CPU @ 2.40GHz × 12 has this execution time:
As it seems there's no way to speed up the existing extension, this issue aims to create a lightweight version with less responsibilities but more speed.
check that
The mockito message in the stacktrace have useful information, but it didn't help
The problematic code (if that's possible) is copied here;
Note that some configuration are impossible to mock via Mockito
Provide versions (mockito / jdk / os / any other relevant information)
I am still not sure what the intent of this extension is. If the extension does not instantiate mocks, then what would it be used for? I think the reason you are looking for an extension is the checks of strict mocks, but your PR also manages static mocks to close them. Rather than such an extension, can you call the required API instead in a @AfterEach?
Thanks @TimvdLippe . The idea is to have something similar to the regular extension but much quicker (as per screenshots). Quicker, without paying the price of having developers over-mocking.
The drawback is that annotations are no longer supported, so developers are responsible of creating their mocks.
We'd like to have this approach in each test without the need of define @AfterEach in each test definition
This issue relates with #1509 for the Mockito Junit 5 extension.
The extension is precious to write maintainable code which automatically creates, injects mocks OOTB and validates that all mocks are correctly used. All of this comes with a price: all of this magic slows down each unit test.
For example, a simple unit test written Junit 5.10.1 with mockito Extension 5.8.0
played via
17.0.9-zulu
onUbuntu 22.04.3 LTS
virtualized overIntel i9-10885H CPU @ 2.40GHz × 12
has this execution time:As it seems there's no way to speed up the existing extension, this issue aims to create a lightweight version with less responsibilities but more speed.
check that
Note that some configuration are impossible to mock via Mockito
(same as any question on stackoverflow.com)
The text was updated successfully, but these errors were encountered: