Class DynamicMockMethod

java.lang.Object
org.spockframework.mock.runtime.DynamicMockMethod
All Implemented Interfaces:
IMockMethod

public class DynamicMockMethod extends Object implements IMockMethod
  • Constructor Details

    • DynamicMockMethod

      public DynamicMockMethod(String methodName, int argumentCount, boolean isStatic)
    • DynamicMockMethod

      public DynamicMockMethod(String methodName, List<Type> parameterTypes, Type returnType, boolean isStatic)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: IMockMethod
      Returns the name of the method.
      Specified by:
      getName in interface IMockMethod
      Returns:
      the name of the method
    • getParameterTypes

      public List<Class<?>> getParameterTypes()
      Description copied from interface: IMockMethod
      Returns the exact parameter types of the method. If no static type information is available for the method, parameters are assumed to have type Object.
      Specified by:
      getParameterTypes in interface IMockMethod
      Returns:
      the parameter types of the method
    • getExactParameterTypes

      public List<Type> getExactParameterTypes()
      Description copied from interface: IMockMethod
      Returns the exact parameter types of the method. Each returned Type is either a Class or a ParameterizedType. Unbound type parameters are substituted with Object. If no static type information is available for the method, parameters are assumed to have type Object.
      Specified by:
      getExactParameterTypes in interface IMockMethod
      Returns:
      the exact parameter types of the method
    • getReturnType

      public Class<?> getReturnType()
      Description copied from interface: IMockMethod
      Returns the return type of the method. If no static type information is available for the method, the return type is assumed to be Object.
      Specified by:
      getReturnType in interface IMockMethod
      Returns:
      the return type of the method
    • getExactReturnType

      public Type getExactReturnType()
      Description copied from interface: IMockMethod
      Returns the exact return type of the method. The returned Type is either a Class or a ParameterizedType. In cases where no static type information is available, the return type is assumed to be Object.
      Specified by:
      getExactReturnType in interface IMockMethod
      Returns:
      the exact return type of the method
    • isStatic

      public boolean isStatic()
      Description copied from interface: IMockMethod
      Tells whether the method is static or an instance method.
      Specified by:
      isStatic in interface IMockMethod
      Returns:
      whether the method is static or an instance method