Class VerboseMockInvocationLogger

java.lang.Object
org.mockito.internal.debugging.VerboseMockInvocationLogger
All Implemented Interfaces:
InvocationListener

public class VerboseMockInvocationLogger extends Object implements InvocationListener
Logs all invocations to standard output. Used for debugging interactions with a mock.
  • Field Details

    • printStream

      final PrintStream printStream
    • mockInvocationsCounter

      private int mockInvocationsCounter
  • Constructor Details

    • VerboseMockInvocationLogger

      public VerboseMockInvocationLogger()
    • VerboseMockInvocationLogger

      public VerboseMockInvocationLogger(PrintStream printStream)
  • Method Details

    • reportInvocation

      public void reportInvocation(MethodInvocationReport methodInvocationReport)
      Description copied from interface: InvocationListener
      Called after the invocation of the listener's mock if it returned normally.

      Exceptions caused by this invocationListener will raise a MockitoException.

      Specified by:
      reportInvocation in interface InvocationListener
      Parameters:
      methodInvocationReport - Information about the method call that just happened.
      See Also:
    • printReturnedValueOrThrowable

      private void printReturnedValueOrThrowable(MethodInvocationReport methodInvocationReport)
    • printStubInfo

      private void printStubInfo(MethodInvocationReport methodInvocationReport)
    • printHeader

      private void printHeader()
    • printInvocation

      private void printInvocation(DescribedInvocation invocation)
    • printFooter

      private void printFooter()
    • printlnIndented

      private void printlnIndented(String message)