Index
A
- AdditionalAnswers class
- annotations
- used, for creating mocks / Creating mocks with annotations, How to do it..., How it works...
- used, for creating mocks with different default answer / Creating mocks with different default answers with annotations, Getting ready, How it works...
- used, for creating spies / Creating spies using annotations, Getting ready, How to do it..., There's more...
- Answer implementation
- argument
- argument matchers
- AssertJ
- assertj-assertions-generator-maven-plugin / Getting ready
- assertj-core file / Getting ready
- assertj-guava file / Getting ready
- assertj-joda-time file / Getting ready
- assertj-neo4j file / Getting ready
- AssertJ assertions
- AssertJ JAR files
- atLeast() method
- atLeastOnce() method
- atMost() method
- Awaitility library
B
C
- @Captor annotation / Getting started with Mockito for JUnit
- calls(
) method
- CallsRealMethods method / There's more...
- catch-exception library
- class
- refactoring, for object instantiation / Removing the problems with instance creation, Getting ready, How it works..., There's more..., See also
- refactoring, that do not follow SOLID principles / Refactoring classes that do too much, Getting ready, How to do it..., See also
- refactoring, that use class casts / Refactoring the classes that use the class casts, Getting ready, How to do it..., See also
- refactoring, that use static methods / Refactoring the classes that use static methods, Getting ready, How to do it..., See also
- CoreMatchers.allOf(...) matcher / How it works...
- CoreMatchers.both(...).and(...) matcher / How it works...
- CoreMatchers.endsWith(...) matcher / How it works...
- CoreMatchers.equalTo(...) matcher / How it works...
- CoreMatchers.hasItems(...) matcher / How it works...
- CoreMatchers.is(...) matcher / How it works...
- CoreMatchers.not(...) matcher / How it works...
- CoreMatchers.notNullValue() matcher / How it works...
- CoreMatchers.startsWith(...) matcher / How it works...
- custom AssertJ assertions
- custom Hamcrest matchers
- customization, mocks
D
- defaultAnswer(...) method / Getting ready
- delegatesTo() method
- delegatesTo answer / Getting ready
- Dependency Injection (DI)
- Dependency inversion
- DoesNothing method / There's more...
- domain-driven design (DDD)
- domain-specific language (DSL)
- Domain Specific Language (DSL)
- don't repeat yourself (DRY) principle / Getting ready
- dummy test doubles
E
F
- fake test doubles
- FEST
- final methods
G
- @Guice annotation
- Guice
- Guice's module configuration
H
- Hamcrest
- hamcrest-all.jar file / Getting ready
- hamcrest-core.jar file / Getting ready
- hamcrest-generator.jar file / Getting ready
- hamcrest-integration.jar file / Getting ready
- hamcrest-library.jar file / Getting ready
- Hamcrest JAR files
- Hamcrest library
- Hamcrest matchers
- URL / Introduction
- using, for assertions / Using Hamcrest matchers for assertions, How to do it..., How it works...
- custom Hamcrest matchers, creating / Creating custom Hamcrest matchers, How to do it...
- using, for stubbing methods / Getting ready, How to do it..., How it works...
- using, for verification / Getting ready, How to do it..., How it works...
- HasPropertyWithValue.hasProperty(...) matcher / How it works...
- hints
I
J
- JAR files
- Java Hamcrest
- JavaScript Object Notation (JSON) message / How to do it...
- JMock
- JMockit
- Jukito
- Jukito annotations
- JukitoRunner
- JUnit
L
- Liskov substitution principle
M
- @Mock annotation / Getting started with Mockito for JUnit
- method invocation
- verifying, that it never happened / Verifying that interactions never happened, Getting ready, There's more...
- verifying, that it stopped happening / Verifying that interactions stopped happening, How it works..., See also
- verifying, for order of interactions / Getting ready, How to do it..., How it works..., There's more...
- verifying, while ignoring stubbed methods / Verifying interactions and ignoring stubbed methods, How it works...
- verifying, within time / Verifying the method invocation within the specified time, How to do it…, There's more...
- method invocation count
- verifying, with times() method / Verifying the method invocation count with times(), Getting ready, How it works..., See also
- verifying, with atLeast() method / Verifying the method invocation count with atLeast(), How to do it..., How it works...
- verifying, with atMost() method / Verifying the method invocation count with atMost(), How to do it..., How it works...
- methods
- stubbing, to return value / Stubbing methods that return values, How to do it..., How it works..., There's more..., See also
- stubbing, to throw exceptions / Stubbing methods so that they throw exceptions, How to do it..., There's more...
- stubbing, to return custom answers / Stubbing methods so that they return custom answers, How to do it..., How it works...
- stubbing, to call real methods / Getting ready, How to do it...
- mock
- mock(Class<T> classToMock) method
- mock(Class<T> classToMock, Answer defaultAnswer) method
- mock(Class<T> classToMock, MockSettings mockSettings) method
- mock(Class<T> classToMock, String name) method
- Mockito
- about / Introduction
- features / Introduction
- adding, to project's classpath / Adding Mockito to a project's classpath, How to do it...
- integrating, with JUnit / Getting started with Mockito for JUnit, Getting ready, How to do it..., There's more...
- integrating, with TestNG / Getting started with Mockito for TestNG, How to do it..., How it works...
- best practices, for testing / Mockito best practices – test behavior not implementation, How to do it...
- hints, adding to exception messages / Adding Mockito hints to exception messages (JUnit) (Experimental), Getting ready, How it works...
- warning messages, adding to JUnit test / Adding additional Mockito warnings to your tests (JUnit) (Experimental), How to do it...
- versus EasyMock / Mockito versus EasyMock, How to do it..., How it works..., There's more...
- and EasyMock, similarities / There's more...
- versus JMockit / Mockito versus JMockit, Getting ready, How to do it..., There's more...
- and JMockit, similarities / There's more...
- versus JMock / Mockito versus JMock, Getting ready, How to do it..., How it works..., There's more...
- and JMock, similarities / There's more...
- versus Spock / Mockito versus Spock, Getting ready, How to do it..., How it works..., There's more...
- and Spock, similarities / There's more...
- mockito-all.jar
- mockito-core.jar
- Mockito.mock method
- Mockito annotations
- MockitoSettings interface methods
- mocks
- creating / Creating mocks in code, Getting ready, How it works...
- creating, with annotations / Creating mocks with annotations, How to do it..., How it works...
- creating, with different default answer / Creating mocks with a different default answer, Getting ready, How to do it..., There's more...
- creating with different default answer, annotations used / Creating mocks with different default answers with annotations, Getting ready, How it works...
- customization / Creating mocks with custom configuration, Getting ready, How it works..., There's more...
- strict mock / Introduction
- non-strict mock / Introduction
- mocks of enums
- mocks of final classes
- mockStatic(...) method / How to do it...
- mock test doubles
- Moco
N
O
- object instantiation
- Open/closed principle
- OrderingComparison.greaterThan(...) matcher / How it works...
P
- partial mocks
- PersonProcessor class
- PersonSaver class / Getting ready
- PowerMock
- used, for creating mocks of final classes / Creating mocks of final classes with PowerMock, Getting ready, How to do it..., How it works...
- using, with JUnit / How to do it...
- using, with TestNG / How to do it...
- used, for creating mocks of enums / Creating mocks of enums with PowerMock, How to do it..., How it works...
- used, for creating spies / Creating spies of final classes with PowerMock, Getting ready, How to do it..., How it works...
- used, for stubbing final methods / Stubbing final methods with PowerMock, Getting ready, How to do it..., How it works...
- used, for stubbing static methods / Stubbing static methods with PowerMock, Getting ready, How to do it..., How it works...
- URL / See also
- used, for stubbing object instantiation / Stubbing object instantiation using PowerMock, How to do it..., How it works...
- used, for stubbing final methods of spies / Stubbing final methods with PowerMock, Getting ready, How to do it..., How it works...
- used with JUnit, for stubbing final methods of spies / How to do it...
- used with TestNG, for stubbing final methods of spies / How to do it...
R
- refactoring
- refactoring, class
- for object instantiation / Removing the problems with instance creation, Getting ready, How it works..., There's more..., See also
- that do not follow SOLID principles / Refactoring classes that do too much, Getting ready, How to do it..., See also
- that use class casts / Refactoring the classes that use the class casts, Getting ready, How to do it..., See also
- that use static methods / Refactoring the classes that use static methods, Getting ready, How to do it..., See also
- refactoring, test class
- refEq(...) argument matcher / Getting ready
- returnsArgAt answer / Getting ready
- ReturnsArgumentAt method / There's more...
- ReturnsDeepStubs method / There's more...
- returnsElementsOf answer / Getting ready
- ReturnsElementsOf method / There's more...
- returnsFirstArg answer / Getting ready
- returnsLastArg answer / Getting ready
- ReturnsMocks method / There's more...
- returnsSecondArg answer / Getting ready
- role interfaces
S
- @Spy annotation / Getting started with Mockito for JUnit
- serializable() method / Getting ready
- Single responsibility principle
- SOLID principles
- spiedInstance(...) method / Getting ready
- spies
- about / Introduction
- creating / Creating spies in code, Getting ready, How to do it..., How it works...
- creating, with custom configuration / Creating spies with custom configuration, Getting ready, How to do it..., How it works...
- creating, annotations used / Creating spies using annotations, Getting ready, How to do it..., There's more...
- creating, PowerMock used / Creating spies of final classes with PowerMock, Getting ready, How to do it..., How it works...
- stubbing methods / Introduction
- Spock
- Spock Web Console
- Spring
- Spring's code configuration
- Spring's XML configuration
- Springockito
- Springockito's annotations
- spy test doubles
- startsWith(...) argument matcher / Getting ready
- static expect(T mock) method / How it works...
- static expectLastCall() method / How it works...
- static methods
- strict mock
- stub
- stubbing
- stubbing, final methods
- stubbing, methods
- to return value / Stubbing methods that return values, How to do it..., How it works..., There's more...
- to throw exceptions / Stubbing methods so that they throw exceptions, How to do it..., There's more..., See also
- to return custom answers / Getting ready, How to do it..., How it works...
- to call real methods / Stubbing methods so that they call real methods, Getting ready, How to do it...
- stubbing, object instantiation
- stubbing, static methods
- stubbing, void methods
- stubbing final methods, spies
- stubbing methods, spies
- stubbing void methods, spies
- stub test doubles
- System Under Test (SUT)
T
- TaxFactorFetcher class / Getting ready
- TaxFactorProcessor class / Getting ready
- TaxService class / Getting ready
- TaxTransferer class
- test class
- test doubles
- URL / Introduction
- about / Introduction
- injecting, Spring's code configuration used / Injecting test doubles instead of beans using Spring's code configuration, Getting ready, How to do it..., There's more..., See also
- injecting, Spring's XML configuration used / Injecting test doubles instead of beans using Spring's XML configuration, Getting ready, How to do it..., How it works...
- injecting, Springockito's annotations used / Injecting test doubles instead of beans using Springockito, Getting ready, How to do it..., How it works..., There's more...
- injecting, Guice's module configuration used / Getting ready, How to do it..., How it works...
- injecting, Jukito annotations used / Injecting test doubles instead of beans with Guice using Jukito, Getting ready, How to do it..., How it works..., There's more...
- test doubles, types
- TestNG
- ThrowsExceptionClass method / There's more...
- ThrowsException method / There's more...
- timeout(
) method
- times() method
- toString() method / There's more...
U
V
- verboseLogging() method / Getting ready
- verify method
- void methods
- stubbing / Stubbing void methods, How it works...
- stubbing, to throw exception / Stubbing void methods so that they throw exceptions, How to do it..., How it works...
- stubbing, to return custom answers / Stubbing void methods so that they return custom answers, How to do it..., How it works...
- stubbing, to call real methods / Stubbing void methods so that they call real methods, How to do it..., How it works...
W
- warning messages
- WireMock