Just wanted to share my personal opinion on these 2 great mocking frameworks for Java. After years of experience with both of them…
…I say Mockito is better.
Mainly because it requires less code to do the same.
I don’t want to provide a detailed evidence. It’s just my personal preference which is a result of my professional experience with both frameworks.
One thing worth to mention: EasyMock was the first mocking framework for Java I started to use and I do not replace things without a reason. So I was likely not to switch to Mockito at the beginning. Yet it convinced me to do so. 🙂
UPDATE: Please note that Mockito is a default dependency introduced by spring-boot-starter-test. This means guys behind Spring Boot have a similar opinion.