Posts Tagged ‘Mockito’

Mock Me With Fewer Words

May 1st, 2011

With Mockito 1.8.3 or higher you can significantly reduce your test code setup.
» Read more: Mock Me With Fewer Words

Would you start mocking me?

August 5th, 2010

One of the primary principles of unit testing is to test a small piece of functionality in isolation. In order to achieve this, mock objects are often necessary. Historically using mocks could be quite painful. After using several mock frameworks, my favorite by far is Mockito.


In this tutorial we will walk through examples of the most common features of Mockito. My sample project can be downloaded here.

Interfaces and Implementation

Some mocking frameworks only supported mocking interfaces. As a result our projects became bloated with useless interfaces that were only used for testing.  Mockito creates mock objects with interfaces or classes.
» Read more: Would you start mocking me?