舉報

會員
Mockito Cookbook
最新章節(jié):
Index
Thisisafocusedguidewithlotsofpracticalrecipeswithpresentationsofbusinessissuesandpresentationofthewholetestofthesystem.ThisbookshowstheuseofMockito'spopularunittestingframeworkssuchasJUnit,PowerMock,TestNG,andsoon.Ifyouareasoftwaredeveloperwithnotestingexperience(especiallywithMockito)andyouwanttostartusingMockitointhemostefficientwaythenthisbookisforyou.ThisbookassumesthatyouhaveagoodknowledgelevelandunderstandingofJava-basedunittestingframeworks.
最新章節(jié)
- Index
- Mockito versus Spock
- Mockito versus JMock
- Mockito versus JMockit
- Mockito versus EasyMock
- Introduction
品牌:中圖公司
上架時間:2021-07-16 10:16:34
出版社:Packt Publishing
本書數(shù)字版權(quán)由中圖公司提供,并由其授權(quán)上海閱文信息技術(shù)有限公司制作發(fā)行
- Index 更新時間:2021-07-16 11:35:15
- Mockito versus Spock
- Mockito versus JMock
- Mockito versus JMockit
- Mockito versus EasyMock
- Introduction
- Chapter 10. Mocking Libraries Comparison
- Injecting test doubles instead of beans with Guice using Jukito
- Injecting test doubles instead of beans with Guice
- Injecting test doubles instead of beans using Springockito
- Injecting test doubles instead of beans using Spring's XML configuration
- Injecting test doubles instead of beans using Spring's code configuration
- Introduction
- Chapter 9. Integration Testing with Mockito and DI Frameworks
- Refactoring the tests that use too many mocks
- Refactoring the classes that use static methods
- Refactoring the classes that use the class casts
- Refactoring classes that do too much
- Removing the problems with instance creation
- Introduction
- Chapter 8. Refactoring with Mockito
- Capturing and asserting the argument
- Creating custom AssertJ assertions
- Using AssertJ for assertions
- Using Hamcrest matchers for stubbing and verification
- Creating custom Hamcrest matchers
- Using Hamcrest matchers for assertions
- Introduction
- Chapter 7. Verifying Behavior with Object Matchers
- Verifying the method invocation within the specified time
- Verifying interactions and ignoring stubbed methods
- Verifying the order of interactions
- Verifying that interactions stopped happening
- Verifying that interactions never happened
- Verifying the method invocation count with atMost()
- Verifying the method invocation count with atLeast()
- Verifying the method invocation count with times()
- Introduction
- Chapter 6. Verifying Test Doubles
- Stubbing final methods with PowerMock
- Stubbing void methods so that they return custom answers
- Stubbing void methods so that they throw exceptions
- Stubbing void methods
- Stubbing methods so that they return custom answers
- Stubbing methods so that they throw exceptions
- Stubbing methods that return values
- Introduction
- Chapter 5. Stubbing Behavior of Spies
- Stubbing object instantiation using PowerMock
- Stubbing static methods with PowerMock
- Stubbing final methods with PowerMock
- Stubbing void methods so that they call real methods
- Stubbing void methods so that they return custom answers
- Stubbing void methods so that they throw exceptions
- Stubbing void methods
- Stubbing methods so that they call real methods
- Stubbing methods so that they return custom answers
- Stubbing methods so that they throw exceptions
- Stubbing methods that return values
- Using argument matchers for stubbing
- Introduction
- Chapter 4. Stubbing Behavior of Mocks
- Creating spies of final classes with PowerMock
- Creating partial mocks of final classes with delegatesTo()
- Creating partial mocks
- Creating spies using annotations
- Creating spies with custom configuration
- Creating spies in code
- Introduction
- Chapter 3. Creating Spies and Partial Mocks
- Creating mocks of enums with PowerMock
- Creating mocks of final classes with PowerMock
- Creating mocks with custom configuration
- Creating mocks with different default answers with annotations
- Creating mocks with a different default answer
- Creating mocks with annotations
- Creating mocks in code
- Introduction
- Chapter 2. Creating Mocks
- Adding additional Mockito warnings to your tests (JUnit) (Experimental)
- Adding Mockito hints to exception messages (JUnit) (Experimental)
- Mockito best practices – test behavior not implementation
- Getting started with Mockito for TestNG
- Getting started with Mockito for JUnit
- Adding Mockito to a project's classpath
- Introduction
- Chapter 1. Getting Started with Mockito
- Customer support
- Reader feedback
- Conventions
- Who this book is for
- What you need for this book
- What this book covers
- Preface
- Support files eBooks discount offers and more
- www.PacktPub.com
- About the Reviewers
- About the Author
- Credits
- Mockito Cookbook
- coverpage
- coverpage
- Mockito Cookbook
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Support files eBooks discount offers and more
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Chapter 1. Getting Started with Mockito
- Introduction
- Adding Mockito to a project's classpath
- Getting started with Mockito for JUnit
- Getting started with Mockito for TestNG
- Mockito best practices – test behavior not implementation
- Adding Mockito hints to exception messages (JUnit) (Experimental)
- Adding additional Mockito warnings to your tests (JUnit) (Experimental)
- Chapter 2. Creating Mocks
- Introduction
- 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
- Chapter 3. Creating Spies and Partial Mocks
- Introduction
- 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
- Chapter 4. Stubbing Behavior of Mocks
- Introduction
- Using argument matchers for stubbing
- Stubbing methods that return values
- Stubbing methods so that they throw exceptions
- Stubbing methods so that they return custom answers
- Stubbing methods so that they call real methods
- Stubbing void methods
- Stubbing void methods so that they throw exceptions
- Stubbing void methods so that they return custom answers
- Stubbing void methods so that they call real methods
- Stubbing final methods with PowerMock
- Stubbing static methods with PowerMock
- Stubbing object instantiation using PowerMock
- Chapter 5. Stubbing Behavior of Spies
- Introduction
- Stubbing methods that return values
- Stubbing methods so that they throw exceptions
- Stubbing methods so that they return custom answers
- Stubbing void methods
- Stubbing void methods so that they throw exceptions
- Stubbing void methods so that they return custom answers
- Stubbing final methods with PowerMock
- Chapter 6. Verifying Test Doubles
- Introduction
- Verifying the method invocation count with times()
- Verifying the method invocation count with atLeast()
- Verifying the method invocation count with atMost()
- Verifying that interactions never happened
- Verifying that interactions stopped happening
- Verifying the order of interactions
- Verifying interactions and ignoring stubbed methods
- Verifying the method invocation within the specified time
- Chapter 7. Verifying Behavior with Object Matchers
- Introduction
- Using Hamcrest matchers for assertions
- Creating custom Hamcrest matchers
- Using Hamcrest matchers for stubbing and verification
- Using AssertJ for assertions
- Creating custom AssertJ assertions
- Capturing and asserting the argument
- Chapter 8. Refactoring with Mockito
- Introduction
- Removing the problems with instance creation
- Refactoring 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
- Chapter 9. Integration Testing with Mockito and DI Frameworks
- Introduction
- Injecting test doubles instead of beans using Spring's code configuration
- Injecting test doubles instead of beans using Spring's XML configuration
- Injecting test doubles instead of beans using Springockito
- Injecting test doubles instead of beans with Guice
- Injecting test doubles instead of beans with Guice using Jukito
- Chapter 10. Mocking Libraries Comparison
- Introduction
- Mockito versus EasyMock
- Mockito versus JMockit
- Mockito versus JMock
- Mockito versus Spock
- Index 更新時間:2021-07-16 11:35:15