Interface AbstractMockChecker.MockForbidder

Enclosing class:
AbstractMockChecker<T extends Annotation>

public static interface AbstractMockChecker.MockForbidder
A policy for determining what classes should not be mocked.

This interface's intended use is to forbid mocking of classes you don't control, for example those in the JDK itself or in a library you use.

  • Method Details

    • forbidReason

      Optional<AbstractMockChecker.Reason> forbidReason​( type, VisitorState state)
      If the given type should not be mocked, provide an explanation why.
      type - the type that is being mocked
      the reason it should not be mocked