Class Returns

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
      private java.lang.Object value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Returns​(java.lang.Object value)  
    • Field Detail

      • value

        private final java.lang.Object value
    • Constructor Detail

      • Returns

        public Returns​(java.lang.Object value)
    • Method Detail

      • answer

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

        public void validateFor​(InvocationOnMock invocation)
        Description copied from interface: ValidableAnswer
        Validation of the answer at stub time for the given invocation.

        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.

        Specified by:
        validateFor in interface ValidableAnswer
        Parameters:
        invocation - The stubbed invocation
      • printReturnType

        private java.lang.String printReturnType()
      • returnType

        private java.lang.Class<?> returnType()
      • returnsNull

        private boolean returnsNull()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object