Class MockDetector

java.lang.Object
org.spockframework.mock.MockDetector

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

    • MockDetector

      public MockDetector()
  • Method Details

    • isMock

      public boolean isMock(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(Object object)
      Returns information about a mock object.
      Parameters:
      object - a mock object
      Returns:
      information about the mock object
      Throws:
      IllegalArgumentException - if the given object is not a mock object