O'Reilly logo

Test-Driven Development with Mockito by Sujoy Acharya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drinking Mockito

Download the latest Mockito binary from the following link and add to the project dependency:

http://code.google.com/p/mockito/downloads/list

To add Mockito JAR files to the project dependency, carry out the following steps:

  1. Extract the JAR files into a folder.
  2. Open an Eclipse project.
  3. Go to the Libraries tab in the project build path.
  4. Click on the Add External JARs... button and browse to the Mockito JAR folder.
  5. Select all JAR files and hit OK.
    Drinking Mockito

Retail shops publicize different promotional offers such as "buy one get 2 free" or "buy 2.5 kg sugar and get 30 percent off". The following BiggestBazarRetail class represents a retail shop:

public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required