Uses of Interface
org.mockito.stubbing.Answer
-
Packages that use Answer Package Description org.mockito Mockito is a mock library for java - see Mockito class for for usage.org.mockito.configuration Mockito configuration utilitiesorg.mockito.internal Internal classes, not to be used by clients.org.mockito.internal.configuration Mockito configurationorg.mockito.internal.creation Mock object creation.org.mockito.internal.creation.settings org.mockito.internal.stubbing Stubbing logic.org.mockito.internal.stubbing.answers Answers for stubbed callsorg.mockito.internal.stubbing.defaultanswers Implementations of ReturnValuesorg.mockito.mock org.mockito.stubbing External stubbing related classesorg.mockito.stubbing.answers -
-
Uses of Answer in org.mockito
Fields in org.mockito declared as Answer Modifier and Type Field Description static Answer<java.lang.Object>
Mockito. CALLS_REAL_METHODS
OptionalAnswer
to be used withMockito.mock(Class, Answer)
static Answer<java.lang.Object>
Mockito. RETURNS_DEEP_STUBS
OptionalAnswer
to be used withMockito.mock(Class, Answer)
.static Answer<java.lang.Object>
Mockito. RETURNS_DEFAULTS
The defaultAnswer
of every mock if the mock was not stubbed.static Answer<java.lang.Object>
Mockito. RETURNS_MOCKS
OptionalAnswer
to be used withMockito.mock(Class, Answer)
static Answer<java.lang.Object>
Mockito. RETURNS_SMART_NULLS
OptionalAnswer
to be used withMockito.mock(Class, Answer)
.Methods in org.mockito that return Answer Modifier and Type Method Description static <T> Answer<T>
AdditionalAnswers. delegatesTo(java.lang.Object delegate)
An answer that directly forwards the calls to the delegate.Answer<java.lang.Object>
Answers. get()
static <T> Answer<T>
AdditionalAnswers. returnsArgAt(int position)
Returns the parameter of an invocation at the given position.static <T> Answer<T>
AdditionalAnswers. returnsElementsOf(java.util.Collection<?> elements)
Returns elements of the collection.static <T> Answer<T>
AdditionalAnswers. returnsFirstArg()
Returns the first parameter of an invocation.static <T> Answer<T>
AdditionalAnswers. returnsLastArg()
Returns the last parameter of an invocation.static <T> Answer<T>
AdditionalAnswers. returnsSecondArg()
Returns the second parameter of an invocation.Methods in org.mockito with parameters of type Answer Modifier and Type Method Description MockSettings
MockSettings. defaultAnswer(Answer defaultAnswer)
Specifies default answers to interactions.static Stubber
Mockito. doAnswer(Answer answer)
UsedoAnswer()
when you want to stub a void method with genericAnswer
.static <T> T
Mockito. mock(java.lang.Class<T> classToMock, Answer defaultAnswer)
Creates mock with a specified strategy for its answers to interactions.BDDMockito.BDDMyOngoingStubbing<T>
BDDMockito.BDDMyOngoingStubbing. will(Answer<?> answer)
See originalOngoingStubbing.then(Answer)
BDDMockito.BDDMyOngoingStubbing<T>
BDDMockito.BDDOngoingStubbingImpl. will(Answer<?> answer)
Deprecated.BDDMockito.BDDMyOngoingStubbing<T>
BDDMockito.BDDMyOngoingStubbing. willAnswer(Answer<?> answer)
See originalOngoingStubbing.thenAnswer(Answer)
BDDMockito.BDDMyOngoingStubbing<T>
BDDMockito.BDDOngoingStubbingImpl. willAnswer(Answer<?> answer)
Deprecated.BDDMockito.BDDStubber
BDDMockito.BDDStubber. willAnswer(Answer answer)
See originalStubber.doAnswer(Answer)
BDDMockito.BDDStubber
BDDMockito.BDDStubberImpl. willAnswer(Answer answer)
Deprecated.static BDDMockito.BDDStubber
BDDMockito. willAnswer(Answer answer)
see originalMockito.doAnswer(Answer)
-
Uses of Answer in org.mockito.configuration
Methods in org.mockito.configuration that return Answer Modifier and Type Method Description Answer<java.lang.Object>
DefaultMockitoConfiguration. getDefaultAnswer()
Answer<java.lang.Object>
IMockitoConfiguration. getDefaultAnswer()
Allows configuring the default answers of unstubbed invocations -
Uses of Answer in org.mockito.internal
Methods in org.mockito.internal with parameters of type Answer Modifier and Type Method Description Stubber
MockitoCore. doAnswer(Answer answer)
Method parameters in org.mockito.internal with type arguments of type Answer Modifier and Type Method Description void
InternalMockHandler. setAnswersForStubbing(java.util.List<Answer> answers)
-
Uses of Answer in org.mockito.internal.configuration
Methods in org.mockito.internal.configuration that return Answer Modifier and Type Method Description Answer<java.lang.Object>
GlobalConfiguration. getDefaultAnswer()
-
Uses of Answer in org.mockito.internal.creation
Methods in org.mockito.internal.creation that return Answer Modifier and Type Method Description Answer<java.lang.Object>
MockSettingsImpl. getDefaultAnswer()
Methods in org.mockito.internal.creation with parameters of type Answer Modifier and Type Method Description MockSettings
MockSettingsImpl. defaultAnswer(Answer defaultAnswer)
-
Uses of Answer in org.mockito.internal.creation.settings
Fields in org.mockito.internal.creation.settings declared as Answer Modifier and Type Field Description protected Answer<java.lang.Object>
CreationSettings. defaultAnswer
Methods in org.mockito.internal.creation.settings that return Answer Modifier and Type Method Description Answer<java.lang.Object>
CreationSettings. getDefaultAnswer()
-
Uses of Answer in org.mockito.internal.stubbing
Classes in org.mockito.internal.stubbing that implement Answer Modifier and Type Class Description class
StubbedInvocationMatcher
Methods in org.mockito.internal.stubbing with parameters of type Answer Modifier and Type Method Description void
InvocationContainerImpl. addAnswer(Answer answer)
void
InvocationContainerImpl. addAnswer(Answer answer, boolean isConsecutive)
void
StubbedInvocationMatcher. addAnswer(Answer answer)
void
InvocationContainerImpl. addAnswerForVoidMethod(Answer answer)
void
InvocationContainerImpl. addConsecutiveAnswer(Answer answer)
Stubber
StubberImpl. doAnswer(Answer answer)
OngoingStubbing<T>
ConsecutiveStubbing. then(Answer<?> answer)
OngoingStubbing<T>
OngoingStubbingImpl. then(Answer<?> answer)
OngoingStubbing<T>
ConsecutiveStubbing. thenAnswer(Answer<?> answer)
OngoingStubbing<T>
OngoingStubbingImpl. thenAnswer(Answer<?> answer)
DeprecatedOngoingStubbing<T>
ConsecutiveStubbing. toAnswer(Answer<?> answer)
DeprecatedOngoingStubbing<T>
OngoingStubbingImpl. toAnswer(Answer<?> answer)
VoidMethodStubbable<T>
VoidMethodStubbableImpl. toAnswer(Answer<?> answer)
Method parameters in org.mockito.internal.stubbing with type arguments of type Answer Modifier and Type Method Description void
InvocationContainerImpl. setAnswersForStubbing(java.util.List<Answer> answers)
Constructors in org.mockito.internal.stubbing with parameters of type Answer Constructor Description StubbedInvocationMatcher(InvocationMatcher invocation, Answer answer)
-
Uses of Answer in org.mockito.internal.stubbing.answers
Classes in org.mockito.internal.stubbing.answers that implement Answer Modifier and Type Class Description class
AnswerReturnValuesAdapter
class
CallsRealMethods
Optional Answer that adds partial mocking supportclass
ClonesArguments
class
DoesNothing
class
Returns
class
ReturnsArgumentAt
Returns the passed parameter identity at specified index.class
ReturnsElementsOf
Returns elements of the collection.class
ThrowsException
class
ThrowsExceptionClass
Methods in org.mockito.internal.stubbing.answers with parameters of type Answer Modifier and Type Method Description void
AnswersValidator. validate(Answer<?> answer, Invocation invocation)
-
Uses of Answer in org.mockito.internal.stubbing.defaultanswers
Classes in org.mockito.internal.stubbing.defaultanswers that implement Answer Modifier and Type Class Description class
ForwardsInvocations
Internal answer to forward invocations on a real instance.class
GloballyConfiguredAnswer
Globally configured Answer.class
ReturnsDeepStubs
Returning deep stub implementation.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 withMockito.mock(Class, Answer)
Methods in org.mockito.internal.stubbing.defaultanswers that return Answer Modifier and Type Method Description Answer<java.lang.Object>
Answers. get()
Deprecated. -
Uses of Answer in org.mockito.mock
Methods in org.mockito.mock that return Answer Modifier and Type Method Description Answer
MockCreationSettings. getDefaultAnswer()
the default answer for this mock, seeMockSettings.defaultAnswer(org.mockito.stubbing.Answer)
. -
Uses of Answer in org.mockito.stubbing
Methods in org.mockito.stubbing with parameters of type Answer Modifier and Type Method Description Stubber
Stubber. doAnswer(Answer answer)
Use it for stubbing consecutive calls inMockito.doAnswer(Answer)
style:OngoingStubbing<T>
OngoingStubbing. then(Answer<?> answer)
Sets a generic Answer for the method.OngoingStubbing<T>
OngoingStubbing. thenAnswer(Answer<?> answer)
Sets a generic Answer for the method.DeprecatedOngoingStubbing<T>
DeprecatedOngoingStubbing. toAnswer(Answer<?> answer)
Set a generic Answer for the stubbed method.VoidMethodStubbable<T>
VoidMethodStubbable. toAnswer(Answer<?> answer)
Stubs a void method with genericAnswer
-
Uses of Answer in org.mockito.stubbing.answers
Classes in org.mockito.stubbing.answers that implement Answer Modifier and Type Class Description class
ReturnsElementsOf
Deprecated.
-