Interface MockCreationSettings<T>

    • Method Detail

      • getTypeToMock

        java.lang.Class<T> getTypeToMock()
        Mocked type. An interface or class the mock should implement / extend.
      • getGenericTypeToMock

        java.lang.reflect.Type getGenericTypeToMock()
        The generic type of the mock, if any.
      • getExtraInterfaces

        java.util.Set<java.lang.Class<?>> getExtraInterfaces()
        the extra interfaces the mock object should implement.
      • getSpiedInstance

        java.lang.Object getSpiedInstance()
        the spied instance - needed for spies.
      • getSerializableMode

        SerializableMode getSerializableMode()
        Returns:
        the serializable mode of this mock
      • isStubOnly

        boolean isStubOnly()
        Whether the mock is only for stubbing, i.e. does not remember parameters on its invocation and therefore cannot be used for verification
      • isStripAnnotations

        boolean isStripAnnotations()
        Whether the mock should not make a best effort to preserve annotations.
      • isUsingConstructor

        boolean isUsingConstructor()
        Informs whether the mock instance should be created via constructor
        Since:
        1.10.12
      • getConstructorArgs

        java.lang.Object[] getConstructorArgs()
        Used when arguments should be passed to the mocked object's constructor, regardless of whether these arguments are supplied directly, or whether they include the outer instance.
        Returns:
        An array of arguments that are passed to the mocked object's constructor. If getOuterClassInstance() is available, it is prepended to the passed arguments.
        Since:
        2.7.14
      • getOuterClassInstance

        java.lang.Object getOuterClassInstance()
        Used when mocking non-static inner classes in conjunction with isUsingConstructor()
        Returns:
        the outer class instance used for creation of the mock object via the constructor.
        Since:
        1.10.12
      • isLenient

        @Deprecated
        boolean isLenient()
        Deprecated.
        Use getStrictness() instead. Informs if the mock was created with "lenient" strictness, e.g. having Strictness.LENIENT characteristic. For more information about using mocks with lenient strictness, see MockSettings.lenient().
        Since:
        2.20.0
      • getMockMaker

        java.lang.String getMockMaker()
        Returns the MockMaker which shall be used to create the mock. When the return value is null, the default shall be used.
        Since:
        4.8.0
        See Also:
        MockSettings.mockMaker(String)