Class MockDetector


  • @Beta
    public class MockDetector
    extends java.lang.Object
    Detects mock objects and provides information about them.
    • Constructor Summary

      Constructors 
      Constructor Description
      MockDetector()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IMockObject asMock​(java.lang.Object object)
      Returns information about a mock object.
      boolean isMock​(java.lang.Object object)
      Tells whether the given object is a (Spock) mock object.
      • Methods inherited from class java.lang.Object

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

      • MockDetector

        public MockDetector()
    • Method Detail

      • isMock

        public boolean isMock​(java.lang.Object object)
        Tells whether the given object is a (Spock) mock object.
        Parameters:
        object - an arbitrary object
        Returns:
        whether the given object is a (Spock) mock object
      • asMock

        public IMockObject asMock​(java.lang.Object object)
        Returns information about a mock object.
        Parameters:
        object - a mock object
        Returns:
        information about the mock object
        Throws:
        java.lang.IllegalArgumentException - if the given object is not a mock object