Class MockObject

java.lang.Object
org.spockframework.mock.runtime.MockObject
All Implemented Interfaces:
IMockObject

public class MockObject extends Object implements IMockObject
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: IMockObject
      Returns the name of this mock object, or null if it has no name.
      Specified by:
      getName in interface IMockObject
      Returns:
      the name of this mock object, or null if it has no name
    • getType

      public Class<?> getType()
      Description copied from interface: IMockObject
      Returns the declared type of this mock object.
      Specified by:
      getType in interface IMockObject
      Returns:
      the declared type of this mock object
    • getInstance

      public Object getInstance()
      Description copied from interface: IMockObject
      Returns the instance of this mock object.
      Specified by:
      getInstance in interface IMockObject
      Returns:
      the instance of this mock object
    • isVerified

      public boolean isVerified()
      Description copied from interface: IMockObject
      Tells whether this mock object supports verification of invocations.
      Specified by:
      isVerified in interface IMockObject
      Returns:
      whether this mock object supports verification of invocations
    • getDefaultResponse

      public IDefaultResponse getDefaultResponse()
      Description copied from interface: IMockObject
      Returns the default response strategy for this mock object.
      Specified by:
      getDefaultResponse in interface IMockObject
      Returns:
      the default response strategy for this mock object
    • getSpecification

      public Specification getSpecification()
      Description copied from interface: IMockObject
      Returns the specification that this mock object is attached to.
      Specified by:
      getSpecification in interface IMockObject
      Returns:
      the specification that this mock object is attached to
    • matches

      public boolean matches(Object target, IMockInteraction interaction)
      Description copied from interface: IMockObject
      Tells whether this mock object matches the target of the specified interaction.
      Specified by:
      matches in interface IMockObject
      Parameters:
      target - the target of the interaction
      interaction - an interaction
      Returns:
      whether this mock object matches the target of the specified interaction