Class DefaultDoNotMockEnforcer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String checkTypeForDoNotMockViolation​(java.lang.Class<?> type)
      If this type is allowed to be mocked.
      • Methods inherited from class java.lang.Object

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

      • DefaultDoNotMockEnforcer

        public DefaultDoNotMockEnforcer()
    • Method Detail

      • checkTypeForDoNotMockViolation

        public java.lang.String checkTypeForDoNotMockViolation​(java.lang.Class<?> type)
        Description copied from interface: DoNotMockEnforcer
        If this type is allowed to be mocked. Return an empty optional if the enforcer allows this type to be mocked. Return a message if there is a reason this type can not be mocked. Note that Mockito performs traversal of the type hierarchy. Implementations of this class should therefore not perform type traversal themselves but rely on Mockito.
        Specified by:
        checkTypeForDoNotMockViolation in interface DoNotMockEnforcer
        Parameters:
        type - The type to check
        Returns:
        Optional message if this type can not be mocked, or an empty optional if type can be mocked