Skip to content
Pokechu22 edited this page Aug 5, 2017 · 5 revisions

Mockito is mainstream for testing Java with mocks

Since Mockito became mainstream circa 2009/2010 we stopped maintaining and updating the quotes.

We estimate number of Mockito users to be 2M, based on simple math: according to Oracle (2015 JavaOne data), there are 9M java engs, let's say half of them write unit test (very sad but probably true), let's say half of the remainder uses Mockito.

Stack Overflow community-accepted answer to What's the best mock framework for Java? is Mockito.


Quotes we collected before mass adoption of Mockito

Dan North, the originator of BDD, about the workshop at JAOO 2008 conference:

It was a 'late substitution'. We decided during the main conference that we should use JUnit 4 and Mockito because we think they are the future of TDD and mocking in Java ;)

Ola Bini, core developer of JRuby, in article Java and mocking:

We have been using Mockito for testing which is a first for me. My immediate impression is quite good. It's a nice tool and it allows some very clean testing of stuff that generally becomes quite messy.

Hamlet D'Arcy on his blog:

Mockito really cleans up the unit test by not requiring expectations. Personally, I much prefer the Mockito API to the EasyMock API for that reason.

Technophilia on Mockito's Most helpful stacktrace:

"....Now, I think Mockito has taken over the mantle of the King of error messages. Just as my swooning over Mockito was at its zenith, I encountered the following stacktrace...."

"....How cool is that! Hats off Mockito-team. This developer appreciates the extra few minutes you took to put together that message. It helped me immensely...."

Zach Shaw compared EasyMock vs Mockito:

The google testing blog just published an article Use EasyMock I guess I just disagree. Mockito grew out of EasyMock, and I think they took a great library and made it even better, so I really think the title of the post should have been 'Use Mockito' not EasyMock. Anyway... there's a whole lot more that Mockito does check out the examples and get off the EasyMock and start drinking the Mockito :P

Dhalia Bock calls to drink that Mockito!:

Do yourself and your team a favor and download Mockito and use it. Your sanity will thank you for it.

Ketan Padegaonkar on his blog:

This looks, and reads far better than the JMock syntax, and it was love at first sight; I'm test-infested now.

Jay Fields about ubiquitous assertion syntax:

In Java, the Mockito framework represents a step in the right direction, moving the mock expectations to the end of the test.

Phil Wills blogged:

Mockito makes you think

alittlemadness.com presents an article about stubbing

The difference with Mockito is that stubbing and verification are separated (...) This separation works brilliantly when you donΓÇÖt want to verify everything by default

infoQ article on Mockito 1.5

Piotr Jagielski's article