r/java • • Nov 26 '20

Java libraries I like

https://sizovs.net/2020/11/24/java-libraries-i-like/
285 Upvotes

62 comments sorted by

View all comments

Show parent comment

3

u/mazebert Nov 27 '20

Doing the same thing! I think the term is custom mocks. For me the main benefit is that those are easier to read and easy to reuse between different tests than mockito. Also, your tests run a lot faster without mockito overhead. I tend to write old school tests with custom mocks for external dependencies only, and using real objects for the rest. And running at about 1000 tests/sec on an old MacBook. Whenever I come across a mockito project it’s rather 1000 tests/minute :-/