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

One thought on “Mockito: Java Unit Testing with Mock Objects

  1. I speculate that the inspiration to create a variation of that name came from the sense of irony created by setting a rather violent
    tale in a town of that name. In some tactics, Spider-man
    fought off sadness following the death of his Uncle Ben by turning to crime-fighting.
    It just wasn’t that well made and Colin Ferrell wasn’t that interesting
    as Bullseye either.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s