Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.junit | |
org.mockito.mock | |
org.mockito.plugins |
Mockito plugins allow customization of behavior.
|
org.mockito.stubbing |
External stubbing related classes
|
Modifier and Type | Interface and Description |
---|---|
interface |
MockitoFramework
Mockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.
|
Modifier and Type | Method and Description |
---|---|
void |
MockitoFramework.addListener(MockitoListener listener)
Adds listener to Mockito.
|
static <T,A> Answer<T> |
AdditionalAnswers.answer(Answer1<T,A> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <T,A,B> Answer<T> |
AdditionalAnswers.answer(Answer2<T,A,B> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <T,A,B,C> Answer<T> |
AdditionalAnswers.answer(Answer3<T,A,B,C> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <T,A,B,C,D> |
AdditionalAnswers.answer(Answer4<T,A,B,C,D> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <T,A,B,C,D,E> |
AdditionalAnswers.answer(Answer5<T,A,B,C,D,E> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <A> Answer<Void> |
AdditionalAnswers.answerVoid(VoidAnswer1<A> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <A,B> Answer<Void> |
AdditionalAnswers.answerVoid(VoidAnswer2<A,B> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <A,B,C> Answer<Void> |
AdditionalAnswers.answerVoid(VoidAnswer3<A,B,C> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <A,B,C,D> Answer<Void> |
AdditionalAnswers.answerVoid(VoidAnswer4<A,B,C,D> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static <A,B,C,D,E> |
AdditionalAnswers.answerVoid(VoidAnswer5<A,B,C,D,E> answer)
Creates an answer from a functional interface - allows for a strongly typed answer to be created
ideally in Java 8
|
static MockitoFramework |
Mockito.framework()
For advanced users or framework integrators.
|
MockSettings |
MockSettings.outerInstance(Object outerClassInstance)
Makes it possible to mock non-static inner classes in conjunction with
MockSettings.useConstructor() . |
void |
MockitoFramework.removeListener(MockitoListener listener)
When you add listener using
MockitoFramework.addListener(MockitoListener) make sure to remove it. |
static <T> T |
Mockito.spy(Class<T> classToSpy)
Please refer to the documentation of
Mockito.spy(Object) . |
MockSettings |
MockSettings.useConstructor()
Mockito attempts to use constructor when creating instance of the mock.
|
Modifier and Type | Interface and Description |
---|---|
interface |
VerificationCollector
Use this rule in order to collect multiple verification failures and report at once.
|
Modifier and Type | Method and Description |
---|---|
VerificationCollector |
VerificationCollector.assertLazily()
Enforce all verifications are performed lazily.
|
void |
VerificationCollector.collectAndReport()
Collect all lazily verified behaviour.
|
static VerificationCollector |
MockitoJUnit.collector()
Creates a rule instance that can perform lazy verifications.
|
Modifier and Type | Class and Description |
---|---|
class |
SerializableMode
Mock serializable style.
|
Modifier and Type | Method and Description |
---|---|
Object |
MockCreationSettings.getOuterClassInstance()
Used when mocking non-static inner classes in conjunction with
MockCreationSettings.isUsingConstructor() |
boolean |
MockCreationSettings.isUsingConstructor()
Informs whether the mock instance should be created via constructor
|
Modifier and Type | Interface and Description |
---|---|
static interface |
MockMaker.TypeMockability
Carries the mockability information
|
interface |
PluginSwitch
Allows switching off the plugins that are discovered on classpath.
|
Modifier and Type | Method and Description |
---|---|
MockMaker.TypeMockability |
MockMaker.isTypeMockable(Class<?> type)
Indicates if the given type can be mocked by this mockmaker.
|
Modifier and Type | Interface and Description |
---|---|
interface |
Answer1<T,A>
One parameter function which returns something
|
interface |
Answer2<T,A,B>
Two parameter function which returns something
|
interface |
Answer3<T,A,B,C>
Three parameter function which returns something
|
interface |
Answer4<T,A,B,C,D>
Three parameter function which returns something
|
interface |
Answer5<T,A,B,C,D,E>
Three parameter function which returns something
|
interface |
VoidAnswer1<A>
One parameter void function
|
interface |
VoidAnswer2<A,B>
Two parameter void function
|
interface |
VoidAnswer3<A,B,C>
Two parameter void function
|
interface |
VoidAnswer4<A,B,C,D>
Two parameter void function
|
interface |
VoidAnswer5<A,B,C,D,E>
Two parameter void function
|