Header banner
Revain logoHome Page
Nicholas Erickson photo
1 Level
741 Review
36 Karma

Review on Mockito by Nicholas Erickson

Revainrating 4 out of 5

Nice tool for writing tests fast - but docs needs improvements

I like that it supports refactorings with annotations, which makes my code more readable and maintainable than before. It is not easy to write custom matchers. You need to understand how to use them effectively and then you can do some really cool things with your test suite. The documentation of this library is quite poor. For example, there are no examples at all! Just read their official tutorial (which isn't very detailed). But you have to know what they mean by "Mockery". Otherwise, it's just too hard to get started using Mockito. We were solving our problem related to testing asynchronous operations in Spring Boot microservices.

img 1 attached to Mockito review by Nicholas Erickson



Pros
  • Easy mocking
  • Annotations support
  • Refactoring friendly.
  • Powerful when combined together withe other libraries/frameworks used within project for building complex tests suites such as jUnit Rules or TestNG etc
Cons
  • Not intuitive
  • Documentation could be better