Package org.spockframework.mock
Interface IMockMethod
- All Known Implementing Classes:
DynamicMockMethod,StaticMockMethod
public interface IMockMethod
Represents a method that can be mocked. Typically but not necessarily corresponds to a
physically declared method in an interface or class.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the exact parameter types of the method.Returns the exact return type of the method.getName()Returns the name of the method.Returns the exact parameter types of the method.Class<?> Returns the return type of the method.booleanisStatic()Tells whether the method is static or an instance method.
-
Method Details
-
getName
String getName()Returns the name of the method.- Returns:
- the name of the method
-
getParameterTypes
Returns the exact parameter types of the method. If no static type information is available for the method, parameters are assumed to have typeObject.- Returns:
- the parameter types of the method
-
getExactParameterTypes
Returns the exact parameter types of the method. Each returnedTypeis either aClassor aParameterizedType. Unbound type parameters are substituted withObject. If no static type information is available for the method, parameters are assumed to have typeObject.- Returns:
- the exact parameter types of the method
-
getReturnType
Class<?> getReturnType()Returns the return type of the method. If no static type information is available for the method, the return type is assumed to beObject.- Returns:
- the return type of the method
-
getExactReturnType
Type getExactReturnType()Returns the exact return type of the method. The returnedTypeis either aClassor aParameterizedType. In cases where no static type information is available, the return type is assumed to beObject.- Returns:
- the exact return type of the method
-
isStatic
boolean isStatic()Tells whether the method is static or an instance method.- Returns:
- whether the method is static or an instance method
-