Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.configuration |
Mockito configuration utilities
|
org.mockito.internal |
Internal classes, not to be used by clients.
|
org.mockito.internal.configuration |
Mockito configuration
|
org.mockito.internal.creation |
Mock object creation.
|
org.mockito.internal.stubbing |
Stubbing logic.
|
org.mockito.internal.stubbing.answers |
Answers for stubbed calls
|
org.mockito.internal.stubbing.defaultanswers |
Implementations of ReturnValues
|
org.mockito.stubbing |
External stubbing related classes
|
org.mockito.stubbing.answers |
Modifier and Type | Field and Description |
---|---|
static Answer<Object> |
Mockito.CALLS_REAL_METHODS
Optional Answer to be used with
Mockito.mock(Class, Answer) |
static Answer<Object> |
Mockito.RETURNS_DEEP_STUBS
Optional Answer to be used with
Mockito.mock(Class, Answer) |
static Answer<Object> |
Mockito.RETURNS_DEFAULTS
The default Answer of every mock if the mock was not stubbed.
|
static Answer<Object> |
Mockito.RETURNS_MOCKS
Optional Answer to be used with
Mockito.mock(Class, Answer) |
static Answer<Object> |
Mockito.RETURNS_SMART_NULLS
Optional Answer to be used with
Mockito.mock(Class, Answer) |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
Answers.get() |
Modifier and Type | Method and Description |
---|---|
MockSettings |
MockSettings.defaultAnswer(Answer defaultAnswer)
Specifies default answers to interactions.
|
static Stubber |
Mockito.doAnswer(Answer answer)
Use doAnswer() when you want to stub a void method with generic
Answer . |
static <T> T |
Mockito.mock(Class<T> classToMock,
Answer defaultAnswer)
Creates mock with a specified strategy for its answers to interactions.
|
static BDDMockito.BDDStubber |
BDDMockito.willAnswer(Answer answer)
see original
Mockito.doAnswer(Answer) |
BDDMockito.BDDStubber |
BDDMockito.BDDStubber.willAnswer(Answer answer)
See original
Stubber.doAnswer(Answer) |
BDDMockito.BDDStubber |
BDDMockito.BDDStubberImpl.willAnswer(Answer answer) |
BDDMockito.BDDMyOngoingStubbing<T> |
BDDMockito.BDDMyOngoingStubbing.willAnswer(Answer<?> answer)
See original
OngoingStubbing.thenAnswer(Answer) |
BDDMockito.BDDMyOngoingStubbing<T> |
BDDMockito.BDDOngoingStubbingImpl.willAnswer(Answer<?> answer) |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
IMockitoConfiguration.getDefaultAnswer()
Allows configuring the default answers of unstubbed invocations
|
Answer<Object> |
DefaultMockitoConfiguration.getDefaultAnswer() |
Modifier and Type | Method and Description |
---|---|
Stubber |
MockitoCore.doAnswer(Answer answer) |
Modifier and Type | Method and Description |
---|---|
void |
MockHandlerInterface.setAnswersForStubbing(List<Answer> answers) |
void |
MockHandler.setAnswersForStubbing(List<Answer> answers) |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
GlobalConfiguration.getDefaultAnswer() |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
MockSettingsImpl.getDefaultAnswer() |
Modifier and Type | Method and Description |
---|---|
MockSettings |
MockSettingsImpl.defaultAnswer(Answer defaultAnswer) |
Modifier and Type | Class and Description |
---|---|
class |
StubbedInvocationMatcher |
Modifier and Type | Method and Description |
---|---|
void |
StubbedInvocationMatcher.addAnswer(Answer answer) |
void |
InvocationContainerImpl.addAnswer(Answer answer) |
void |
InvocationContainerImpl.addAnswer(Answer answer,
boolean isConsecutive) |
void |
InvocationContainerImpl.addAnswerForVoidMethod(Answer answer) |
void |
InvocationContainerImpl.addConsecutiveAnswer(Answer answer) |
Stubber |
StubberImpl.doAnswer(Answer answer) |
OngoingStubbing<T> |
OngoingStubbingImpl.thenAnswer(Answer<?> answer) |
OngoingStubbing<T> |
ConsecutiveStubbing.thenAnswer(Answer<?> answer) |
VoidMethodStubbable<T> |
VoidMethodStubbableImpl.toAnswer(Answer<?> answer) |
DeprecatedOngoingStubbing<T> |
OngoingStubbingImpl.toAnswer(Answer<?> answer) |
DeprecatedOngoingStubbing<T> |
ConsecutiveStubbing.toAnswer(Answer<?> answer) |
Modifier and Type | Method and Description |
---|---|
void |
InvocationContainerImpl.setAnswersForStubbing(List<Answer> answers) |
Constructor and Description |
---|
StubbedInvocationMatcher(InvocationMatcher invocation,
Answer answer) |
Modifier and Type | Class and Description |
---|---|
class |
AnswerReturnValuesAdapter |
class |
CallsRealMethods
Optional Answer that adds partial mocking support
|
class |
ClonesArguments |
class |
DoesNothing |
class |
Returns |
class |
ThrowsException |
Modifier and Type | Method and Description |
---|---|
void |
AnswersValidator.validate(Answer<?> answer,
Invocation invocation) |
Modifier and Type | Class and Description |
---|---|
class |
GloballyConfiguredAnswer
Globally configured Answer.
|
class |
ReturnsDeepStubs |
class |
ReturnsEmptyValues
Default answer of every Mockito mock.
|
class |
ReturnsMocks |
class |
ReturnsMoreEmptyValues
It's likely this implementation will be used by default by every Mockito 2.0 mock.
|
class |
ReturnsSmartNulls
Optional Answer that can be used with
Mockito.mock(Class, Answer) |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
Answers.get()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Stubber |
Stubber.doAnswer(Answer answer)
Use it for stubbing consecutive calls in
Mockito.doAnswer(Answer) style: |
OngoingStubbing<T> |
OngoingStubbing.thenAnswer(Answer<?> answer)
Sets a generic Answer for the method.
|
VoidMethodStubbable<T> |
VoidMethodStubbable.toAnswer(Answer<?> answer)
Stubs a void method with generic
Answer |
DeprecatedOngoingStubbing<T> |
DeprecatedOngoingStubbing.toAnswer(Answer<?> answer)
Set a generic Answer for the stubbed method.
|
Modifier and Type | Class and Description |
---|---|
class |
ReturnsElementsOf
Returns elements of the collection.
|
Copyright © 2018. All rights reserved.