Class LambdaAnswer<T>
java.lang.Object
org.mockito.internal.stubbing.defaultanswers.ForwardsInvocations
org.springframework.amqp.rabbit.test.mockito.LambdaAnswer<T>
- Type Parameters:
T
- the return type.
- All Implemented Interfaces:
Serializable
,org.mockito.stubbing.Answer<Object>
public class LambdaAnswer<T>
extends org.mockito.internal.stubbing.defaultanswers.ForwardsInvocations
An
Answer
to optionally call the real method and allow
returning a custom result. Captures any exceptions thrown.- Since:
- 1.6
- Author:
- Gary Russell
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionLambdaAnswer
(boolean callRealMethod, LambdaAnswer.ValueToReturn<T> callback, Object delegate) Construct an instance with the provided properties. -
Method Summary
Modifier and TypeMethodDescriptionanswer
(org.mockito.invocation.InvocationOnMock invocation) Return the exceptions thrown, if any.
-
Constructor Details
-
LambdaAnswer
public LambdaAnswer(boolean callRealMethod, LambdaAnswer.ValueToReturn<T> callback, @Nullable Object delegate) Construct an instance with the provided properties. Use the test harness to get an instance with the proper delegate.- Parameters:
callRealMethod
- true to call the real method.callback
- the call back to receive the result.delegate
- the delegate.
-
-
Method Details