Class Returns

java.lang.Object
org.mockito.internal.stubbing.answers.Returns
All Implemented Interfaces:
Serializable, Answer<Object>

public class Returns extends Object implements Answer<Object>, Serializable
See Also:
  • Constructor Details

    • Returns

      public Returns(Object value)
  • Method Details

    • answer

      public Object answer(InvocationOnMock invocation) throws Throwable
      Specified by:
      answer in interface Answer<Object>
      Parameters:
      invocation - the invocation on the mock.
      Returns:
      the value to be returned
      Throws:
      Throwable - the throwable to be thrown
    • printReturnType

      public String printReturnType()
    • getReturnType

      public Class<?> getReturnType()
    • returnsNull

      public boolean returnsNull()
    • toString

      public String toString()
      Overrides:
      toString in class Object