Class MoreAnswers


  • public class MoreAnswers
    extends java.lang.Object
    A repository of reusable Answers for Mockito.
    Since:
    3.2-ALPHA-8
    Author:
    Fabrizio Giudici
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.mockito.stubbing.Answer<?> CALLS_DEFAULT_METHODS
      An Answer that calls default methods of an interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      MoreAnswers()  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CALLS_DEFAULT_METHODS

        public static final org.mockito.stubbing.Answer<?> CALLS_DEFAULT_METHODS
        An Answer that calls default methods of an interface. To be used as: Foo foo = mock(Foo.class, MoreAnswers.CALLS_DEFAULT_METNODS);. Mockito's Answers.CALLS_REAL_METHODS actually behaves the same when used with interfaces, but it has been designed for mixed mocking, which is a practice that is supposed to be used only with corner cases an legacy stuff.
    • Constructor Detail

      • MoreAnswers

        public MoreAnswers()