Book Image

Mockito Cookbook

By : Marcin Grzejszczak
Book Image

Mockito Cookbook

By: Marcin Grzejszczak

Overview of this book

Table of Contents (17 chapters)
Mockito Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Creating Spies and Partial Mocks

In this chapter, we will cover the following recipes:

  • Creating spies in code

  • Creating spies with custom configuration

  • Creating spies using annotations

  • Creating partial mocks

  • Creating partial mocks of final classes with delegatesTo()

  • Creating spies of final classes with PowerMock