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 8. Refactoring with Mockito

In this chapter, we will cover the following recipes:

  • Removing the problems with instance creation

  • Refactoring the classes that do too much

  • Refactoring the classes that use the class casts

  • Refactoring the classes that use static methods

  • Refactoring the tests that use too many mocks