Tags » Mockito

Mockito Essentials

A practical guide to get you up and running with unit testing using Mockito
About This Book

Explore Mockito features and learn stubbing, mocking and spying dependencies using the… 54 more words


Stubbing void methods to do nothing

This post explains how to change the implementation of void methods to do nothing for testing purposes.

Below is the example

Classes to be tested… 206 more words


jUnit - What is Mocking ?

Before you start reading about mocking ,if you are not familiar with jUnit then have look at this post – jUnit – Unit testing overview… 605 more words


A Little Wiring Tip

Congratulations! You’re reading my very first post in this blog, for which I hope will be an interesting account of my adventures in XP. 565 more words

Dependency Injection

EasyMock vs Mockito

Just wanted to share my personal opinion on these 2 great mocking frameworks for Java. After years of experience with both of them…

…I say… 85 more words



OK, so these probably aren’t the sort of thing that you’d buy for yourself on a regular basis but they are quite fun and make a great gift – especially if the recipient is partaking in Dry January! 145 more words


Expected Exception Rule and Mocking Static Methods - JUnit

Today I was asked to consume a RESTful service so I started implementing it following Robert Cecil Martin’s rules for TDD and came across a new way (atleast for me) of testing the expected exception along with the error message so thought of sharing the way I implemented it as part of this post. 338 more words