Class ForwardsInvocations
- java.lang.Object
-
- org.mockito.internal.stubbing.defaultanswers.ForwardsInvocations
-
- All Implemented Interfaces:
java.io.Serializable
,Answer<java.lang.Object>
public class ForwardsInvocations extends java.lang.Object implements Answer<java.lang.Object>, java.io.Serializable
Internal answer to forward invocations on a real instance.- Since:
- 1.9.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
delegatedObject
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ForwardsInvocations(java.lang.Object delegatedObject)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
answer(InvocationOnMock invocation)
private static boolean
compatibleReturnTypes(java.lang.Class<?> superType, java.lang.Class<?> subType)
private java.lang.reflect.Method
getDelegateMethod(java.lang.reflect.Method mockMethod)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
delegatedObject
private java.lang.Object delegatedObject
-
-
Method Detail
-
answer
public java.lang.Object answer(InvocationOnMock invocation) throws java.lang.Throwable
-
getDelegateMethod
private java.lang.reflect.Method getDelegateMethod(java.lang.reflect.Method mockMethod) throws java.lang.NoSuchMethodException
- Throws:
java.lang.NoSuchMethodException
-
compatibleReturnTypes
private static boolean compatibleReturnTypes(java.lang.Class<?> superType, java.lang.Class<?> subType)
-
-