Nov 11

If you are going to set up a completely new greenfield project, I would definately consider using Mockito as mock framework. It expressive and very intuitive, and results in less boilerplate code in your tests than for example EasyMock.

Very few of us are so lucky to be setting up a completely new project, but are stuck with legacy code that probably require more advanced features than those offered by Mockito. In this case I would probably go for a combination of EasyMock and PowerMock.

2 Responses to “Mockito”

  1. Johan Haleby Says:

    PowerMock 1.1 actually has some basic support for Mockito as well (you can mock static and final methods and final classes etc) using the Mockito extension API.

  2. PowerMock goes Mockito Says:

    [...] which makes it possible to use PowerMock with other test frameworks. In this release, support for Mockito has been added (Thanks for the hint, Jan…). Looking forward to trying [...]

Leave a Reply