Working with Mockito

Mockito is an open source unit mocking framework for Java. It allows mock object creation, verification, and stubbing.

Mockito was moved to GitHub. You can visit https://github.com/mockito/mockito to get the source code, and visit http://code.google.com/p/mockito/ to learn more about Mockito.

Learning the significance of Mockito

We add automated unit tests to run and notify us in case any code breaks the system so that the wrong code can be identified and fixed very quickly.

But when an automated test suite takes time to execute, for instance, two hours to complete a build, it defeats the purpose of quick feedback. In Test-Driven Development (TDD), automated JUnit test cases are run to provide quick feedback. Here, a test should ...

Get Mockito for Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.