Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An example of using TDD with Mockito to build a command line todo list.
Java
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
README.md
build.gradle

README.md

An Intro to TDD with Mockito

This repo has the code for a lightning talk I made at the Jozi JUG meetup on 25 March 2013. The purpose was to show how I normally use Mockito to support TDD. The application is not at all complete, but has examples of the main Mockito features I use:

Creating a Mockito mock object obj of the class Class:

Class obj = mock(Class.class); 

Stub obj.method to return stubbedResponse:

given(obj.method(argsOrMatchers)).willReturn(stubbedResponse); 

Check if obj.method was called:

verify(obj).method(argsOrMatchers)

Refer to the Mockito documentation for more features.

Something went wrong with that request. Please try again.