Loading...

Reviews by real users

Just finished a project using open source libraries and have fresh impressions?

Write a review to share your experiences with open source!

On DevRates we focus on reviews by developers using libraries on their daily work.

Technology radar

Launching a start-up or commercial project using open-source libraries? No time to evaluate various technology stacks?

Interested in the latest trends and top-rated open source projects for all layers of your application?

DevRates contains projects reviews of most popular tagged categories and programming languages.

Build your skill profile

Join DevRates and build your public profile from libraries you know and experience positions from projects you've been involved in.

Follow projects and don't miss any news from blogs and twitter on your wall.

Your company is looking for talented developers? Register on DevRates and show your technology stack on your company profile.

JOIN THE COMMUNITY TAKE A TOUR

Mockito

Homepage

http://code.google.com/p/mockito/

Latest release

1.9.5 (06/10/2012)

Developed by

Licenses

MIT License

Overall rating

9.0
Usability
9.1
Simplicity
9.2
Documentation
8.7
Community
8.6

Tags

  • unit testing

  • tdd

  • java

Description

Java mocking is dominated by expect-run-verify libraries like EasyMock or jMock. Mockito offers simpler and more intuitive approach: you ask questions about interactions after execution. Using mockito, you can verify what you want. Using expect-run-verify libraries you are often forced to look after irrelevant interactions.

No expect-run-verify also means that Mockito mocks are often ready without expensive setup upfront. They aim to be transparent and let the developer to focus on testing selected behavior rather than absorb attention.

Mockito has very slim API, almost no time is needed to start mocking. There is only one kind of mock, there is only one way of creating mocks. Just remember that stubbing goes before execution, verifications of interactions go afterwards. You'll soon notice how natural is that kind of mocking when TDD-ing java code.

Mockito has similar syntax to EasyMock, therefore you can refactor safely. Mockito doesn't understand the notion of 'expectation'. There is only stubbing and verifications.

Mockito implements what Gerard Meszaros calls a Test Spy.

Related projects

Latest reviews

7.5
evialle

Easier than Easy Mock

Appears to be less complete than Powermock...

full review »
Sign in to vote for review score: 1
10.0
piotr

Easy, simple and intuitive. Especially take a look at @InjectMocks and @Mock if You're Spring user.

full review »
Sign in to vote for review score: 0
9.5
peter.keller

Easy to use mock framework with a well designed API.

full review »
Sign in to vote for review score: 0
8.8
peper

Very easy, intuitive and feature-full. I use it along with Powermock (when needed) and Fest assert  and it gives me a complete unit testing workshop.

full review »
Sign in to vote for review score: 0
Please sign in to rate or post a comment
Scroll to top