Have a personal or library account? Click to login
MOCKITO COOKBOOK Cover

MOCKITO COOKBOOK

Over 65 recipes to get you up and running with unit testing using Mockito.

Paid access
|Sep 2025
Product purchase options

Key Features

    Book Description

    What you will learn

    • Create beautiful tests using Mockito
    • Create mocks and spies in a number of ways
    • Implement best practices to perform tests with Mockito
    • Extend Mockito with other popular Javabased unit testing frameworks such as JUnit and PowerMock
    • Stub behavior of mocks and spies
    • Verify test doubles with Mockito
    • Write good tests using Mockito
    • Integrate Mockito with DI systems
    • Compare Mockito to other mocking frameworks
    • Verify the behavior of your system under test

    Who this book is for

    Table of Contents

    1. Getting Started With Mockito
    2. Creating mocks
    3. Creating spies
    4. Stubbing behaviour of mocks
    5. Stubbing behaviour of spies
    6. Verifying test doubles
    7. Verifying with arg matchers
    8. Refactoring with Mockito
    9. Mockito based tools
    10. Mocking libraries comparison
    PDF ISBN: 978-1-78398-275-2
    Publisher: Packt Publishing Limited
    Copyright owner: © 2014 Packt Publishing Limited
    Publication date: 2025
    Language: English
    Pages: 284