Class MockConfiguration

    • Constructor Summary

      Constructors 
      Constructor Description
      MockConfiguration​(java.lang.String name, java.lang.Class<?> type, MockNature nature, MockImplementation implementation, java.util.Map<java.lang.String,​java.lang.Object> options)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Object> getConstructorArgs()
      Returns the constructor arguments to be used for creating the mock object.
      IDefaultResponse getDefaultResponse()
      Returns the default response strategy for the mock object.
      MockImplementation getImplementation()
      Returns the implementation of the mock object.
      java.lang.String getName()
      Returns the name of the mock object.
      MockNature getNature()
      Returns the nature of the mock object.
      java.lang.Class<?> getType()
      Returns the interface or class type of the mock object.
      boolean isGlobal()
      Tells whether a mock object stands in for all objects of the mocked type, or just for itself.
      boolean isUseObjenesis()
      Tells whether the Objenesis library, if available on the class path, should be used for constructing the mock object, rather than calling a constructor.
      boolean isVerified()
      Tells whether invocations on the mock object should be verified.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockConfiguration

        public MockConfiguration​(java.lang.String name,
                                 java.lang.Class<?> type,
                                 MockNature nature,
                                 MockImplementation implementation,
                                 java.util.Map<java.lang.String,​java.lang.Object> options)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: IMockConfiguration
        Returns the name of the mock object.
        Specified by:
        getName in interface IMockConfiguration
        Returns:
        the name of the mock object
      • getType

        public java.lang.Class<?> getType()
        Description copied from interface: IMockConfiguration
        Returns the interface or class type of the mock object.
        Specified by:
        getType in interface IMockConfiguration
        Returns:
        the interface or class type of the mock object
      • getNature

        public MockNature getNature()
        Description copied from interface: IMockConfiguration
        Returns the nature of the mock object. A nature is a named set of defaults for mock configuration options.
        Specified by:
        getNature in interface IMockConfiguration
        Returns:
        the nature of the mock object
      • getConstructorArgs

        public java.util.List<java.lang.Object> getConstructorArgs()
        Description copied from interface: IMockConfiguration
        Returns the constructor arguments to be used for creating the mock object.
        Specified by:
        getConstructorArgs in interface IMockConfiguration
        Returns:
        the constructor arguments to be used for creating the mock object
      • isGlobal

        public boolean isGlobal()
        Description copied from interface: IMockConfiguration
        Tells whether a mock object stands in for all objects of the mocked type, or just for itself. This is an optional feature that may not be supported by a particular MockImplementation.
        Specified by:
        isGlobal in interface IMockConfiguration
        Returns:
        whether a mock object stands in for all objects of the mocked type, or just for itself
      • isVerified

        public boolean isVerified()
        Description copied from interface: IMockConfiguration
        Tells whether invocations on the mock object should be verified. If (@code false}, invocations on the mock object will not be matched against interactions that have a cardinality.
        Specified by:
        isVerified in interface IMockConfiguration
        Returns:
        whether invocations on the mock object should be verified
      • isUseObjenesis

        public boolean isUseObjenesis()
        Description copied from interface: IMockConfiguration
        Tells whether the Objenesis library, if available on the class path, should be used for constructing the mock object, rather than calling a constructor.
        Specified by:
        isUseObjenesis in interface IMockConfiguration
        Returns:
        whether the Objenesis library should be used for constructing the mock object