Mockito Cookbook
上QQ阅读APP看书,第一时间看更新

What this book covers

Chapter 1, Getting Started with Mockito, covers the Mockito configuration for JUnit and TestNG and some of its experimental features.

Chapter 2, Creating Mocks, presents numerous ways to create mocks.

Chapter 3, Creating Spies and Partial Mocks, covers the process of instantiating spy objects and partial mocks.

Chapter 4, Stubbing Behavior of Mocks, shows how to stub the method executions of mock objects.

Chapter 5, Stubbing Behavior of Spies, presents ways to stub the method executions of spies.

Chapter 6, Verifying Test Doubles, covers the process of behavior verification of test doubles.

Chapter 7, Verifying Behavior with Object Matchers, shows how to confirm that your application works as it should using Hamcrest or AssertJ.

Chapter 8, Refactoring with Mockito, covers the process of easily refactoring your production and test code, thanks to Mockito.

Chapter 9, Integration Testing with Mockito and DI Frameworks, presents ways to inject mocks into your Spring– or Guice–based applications.

Chapter 10, Mocking Libraries Comparison, shows the differences and similarities between several mocking libraries and Mockito.