Package org.spockframework.mock
Interface IMockObject
-
- All Known Implementing Classes:
MockObject
public interface IMockObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IDefaultResponsegetDefaultResponse()Returns the default response strategy for this mock object.java.lang.ObjectgetInstance()Returns the instance of this mock object.java.lang.StringgetName()Returns the name of this mock object, ornullif it has no name.SpecificationgetSpecification()Returns the specification that this mock object is attached to.java.lang.Class<?>getType()Returns the declared type of this mock object.booleanisVerified()Tells whether this mock object supports verification of invocations.booleanmatches(java.lang.Object target, IMockInteraction interaction)Tells whether this mock object matches the target of the specified interaction.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of this mock object, ornullif it has no name.- Returns:
- the name of this mock object, or
nullif it has no name
-
getType
java.lang.Class<?> getType()
Returns the declared type of this mock object.- Returns:
- the declared type of this mock object
-
getInstance
java.lang.Object getInstance()
Returns the instance of this mock object.- Returns:
- the instance of this mock object
-
isVerified
boolean isVerified()
Tells whether this mock object supports verification of invocations.- Returns:
- whether this mock object supports verification of invocations
-
getDefaultResponse
IDefaultResponse getDefaultResponse()
Returns the default response strategy for this mock object.- Returns:
- the default response strategy for this mock object
-
getSpecification
Specification getSpecification()
Returns the specification that this mock object is attached to.- Returns:
- the specification that this mock object is attached to
-
matches
boolean matches(java.lang.Object target, IMockInteraction interaction)Tells whether this mock object matches the target of the specified interaction.- Parameters:
target- the target of the interactioninteraction- an interaction- Returns:
- whether this mock object matches the target of the specified interaction
-
-