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_METHODSOptionalAnswerto be used withMockito.mock(Class, Answer)static Answer<java.lang.Object>Mockito. RETURNS_DEEP_STUBSOptionalAnswerto be used withMockito.mock(Class, Answer).static Answer<java.lang.Object>Mockito. RETURNS_DEFAULTSThe defaultAnswerof every mock if the mock was not stubbed.static Answer<java.lang.Object>Mockito. RETURNS_MOCKSOptionalAnswerto be used withMockito.mock(Class, Answer)static Answer<java.lang.Object>Mockito. RETURNS_SMART_NULLSOptionalAnswerto 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 MockSettingsMockSettings. defaultAnswer(Answer defaultAnswer)Specifies default answers to interactions.static StubberMockito. doAnswer(Answer answer)UsedoAnswer()when you want to stub a void method with genericAnswer.static <T> TMockito. 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.BDDStubberBDDMockito.BDDStubber. willAnswer(Answer answer)See originalStubber.doAnswer(Answer)BDDMockito.BDDStubberBDDMockito.BDDStubberImpl. willAnswer(Answer answer)Deprecated.static BDDMockito.BDDStubberBDDMockito. 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 StubberMockitoCore. doAnswer(Answer answer)Method parameters in org.mockito.internal with type arguments of type Answer Modifier and Type Method Description voidInternalMockHandler. 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 MockSettingsMockSettingsImpl. 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. defaultAnswerMethods 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 classStubbedInvocationMatcherMethods in org.mockito.internal.stubbing with parameters of type Answer Modifier and Type Method Description voidInvocationContainerImpl. addAnswer(Answer answer)voidInvocationContainerImpl. addAnswer(Answer answer, boolean isConsecutive)voidStubbedInvocationMatcher. addAnswer(Answer answer)voidInvocationContainerImpl. addAnswerForVoidMethod(Answer answer)voidInvocationContainerImpl. addConsecutiveAnswer(Answer answer)StubberStubberImpl. 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 voidInvocationContainerImpl. 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 classAnswerReturnValuesAdapterclassCallsRealMethodsOptional Answer that adds partial mocking supportclassClonesArgumentsclassDoesNothingclassReturnsclassReturnsArgumentAtReturns the passed parameter identity at specified index.classReturnsElementsOfReturns elements of the collection.classThrowsExceptionclassThrowsExceptionClassMethods in org.mockito.internal.stubbing.answers with parameters of type Answer Modifier and Type Method Description voidAnswersValidator. 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 classForwardsInvocationsInternal answer to forward invocations on a real instance.classGloballyConfiguredAnswerGlobally configured Answer.classReturnsDeepStubsReturning deep stub implementation.classReturnsEmptyValuesDefault answer of every Mockito mock.classReturnsMocksclassReturnsMoreEmptyValuesIt's likely this implementation will be used by default by every Mockito 2.0 mock.classReturnsSmartNullsOptional 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 AnswerMockCreationSettings. 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 StubberStubber. 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 classReturnsElementsOfDeprecated.
-