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

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