Interface MockCreationSettings<T>

    • Method Detail

      • getTypeToMock

        java.lang.Class<T> getTypeToMock()
        Mocked type. An interface or class the mock should implement / extend.
      • 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

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

        @Incubating
        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

        @Incubating
        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

        @Incubating
        boolean isLenient()
        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