public class Returns extends java.lang.Object implements Answer<java.lang.Object>, ValidableAnswer, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
private java.lang.Object |
value |
Constructor and Description |
---|
Returns(java.lang.Object value) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
answer(InvocationOnMock invocation) |
private java.lang.String |
printReturnType() |
private boolean |
returnsNull() |
private java.lang.Class<?> |
returnType() |
java.lang.String |
toString() |
void |
validateFor(InvocationOnMock invocation)
Validation of the answer at stub time for the given invocation.
|
private static final long serialVersionUID
private final java.lang.Object value
public java.lang.Object answer(InvocationOnMock invocation) throws java.lang.Throwable
public void validateFor(InvocationOnMock invocation)
ValidableAnswer
This method will be called by Mockito.
The implementation must throw an MockitoException to indicate that this answer is not valid for the given invocation. If the validation succeed the implementation must simply return without throwing.
validateFor
in interface ValidableAnswer
invocation
- The stubbed invocationprivate java.lang.String printReturnType()
private java.lang.Class<?> returnType()
private boolean returnsNull()
public java.lang.String toString()
toString
in class java.lang.Object