Class DefaultStubbingLookupListener

java.lang.Object
org.mockito.internal.junit.DefaultStubbingLookupListener
All Implemented Interfaces:
Serializable, StubbingLookupListener

class DefaultStubbingLookupListener extends Object implements StubbingLookupListener, Serializable
Default implementation of stubbing lookup listener. Fails early if stub called with unexpected arguments, but only if current strictness is set to STRICT_STUBS.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • currentStrictness

      private Strictness currentStrictness
    • mismatchesReported

      private boolean mismatchesReported
  • Constructor Details

    • DefaultStubbingLookupListener

      DefaultStubbingLookupListener(Strictness strictness)
  • Method Details

    • onStubbingLookup

      public void onStubbingLookup(StubbingLookupEvent event)
      Description copied from interface: StubbingLookupListener
      Called by the framework when Mockito looked up an answer for invocation on a mock. For details, see StubbingLookupListener.
      Specified by:
      onStubbingLookup in interface StubbingLookupListener
      Parameters:
      event - - Information about the looked up stubbing
    • potentialArgMismatches

      private static List<Invocation> potentialArgMismatches(Invocation invocation, Collection<Stubbing> stubbings)
    • setCurrentStrictness

      void setCurrentStrictness(Strictness currentStrictness)
      Enables resetting the strictness to desired level
    • isMismatchesReported

      boolean isMismatchesReported()
      Indicates that stubbing argument mismatch was reported