Have a personal or library account? Click to login
Mockito Essentials Cover

Mockito Essentials

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

Paid access
|Sep 2025
Product purchase options

Key Features

    Book Description

    This book is ideal for developers who have some experience in Java application development as well as some basic knowledge of test doubles and JUnit testing. This book also introduces you to the fundamentals of JUnit testing, test doubles, refactoring legacy code, and writing JUnit tests for GWT and web services.

    What you will learn

    • Explore test doubles and work with dummy, spy, fake, stub, and mock objects
    • Uncover the Mockito architecture and build a custom mocking framework
    • Mock, stub, and spy external code dependencies using Mockito
    • Practice Behaviordriven Development (BDD) with Mockito
    • Make legacy code testable by mocking and spying dependencies
    • Mock GWT and web service dependencies using Mockito
    • Discover argument captors, inline stubbing, and resetting mock objects

    Who this book is for

    Table of Contents

    1. Exploring Test Doubles
    2. Socializing with Mockito
    3. Accelerating Mockito
    4. Behavior-driven Development with Mockito
    5. Unit testing Legacy Code with Mockito
    6. Developing SOA with Mockito
    7. Unit testing GWT code with Mockito
    PDF ISBN: 978-1-78398-361-2
    Publisher: Packt Publishing Limited
    Copyright owner: © 2014 Packt Publishing Limited
    Publication date: 2025
    Language: English
    Pages: 214