JUNIT using Mockito

Here an example unit test code snippet.
Please include the following libraries as provided. if there is some problem with junit-4-11.jar, hamcrest-core.1.3.jar may be needed.

The example shows how we can Mock the return values of the `p` Object, where we do not need to run through all the inner methods of `p`, just create a mock return value.

( optional ) hamcrest-core.1.3.jar

import org.mockito.Mockito;


Property p = Mockito.mock(Property.class);

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