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
About the Author
About the Reviewers

Chapter 2. Creating Mocks

In this chapter, we will cover the following recipes:

  • Creating mocks in code

  • Creating mocks with annotations

  • Creating mocks with a different default answer

  • Creating mocks with different default answers with annotations

  • Creating mocks with custom configuration

  • Creating mocks of final classes with PowerMock

  • Creating mocks of enums with PowerMock