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 IDefaultResponse
getDefaultResponse()
Returns the default response strategy for this mock object.java.lang.Object
getInstance()
Returns the instance of this mock object.java.lang.String
getName()
Returns the name of this mock object, ornull
if it has no name.Specification
getSpecification()
Returns the specification that this mock object is attached to.java.lang.Class<?>
getType()
Returns the declared type of this mock object.boolean
isVerified()
Tells whether this mock object supports verification of invocations.boolean
matches(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, ornull
if it has no name.- Returns:
- the name of this mock object, or
null
if 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
-
-