Mockito: Java Unit Testing with Mock Objects


Mockito is an open source testing framework for Java. The framework allows the creation of Test Double objects called, “Mock Objects” in automated unit tests for the purpose of Test-driven Development (TDD) or Behavior Driven Development (BDD).

Mockito compared to EasyMock seems to be more easily and has more flexibility. First it’s able to mock up interfaces as well as classes. You doesn’t need additional Jar libraries. Furthermore there isn’t any replay mode. First you have to stub and afterwards you have to verificate your mocked classes or interfaces. Further advantages could be read here

Here is an informative tutorial on Mockito, a junit object mocking framework, with nice example of mocking dao layers Notes on Mockito tutorial

A few other helpful links

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s