@NotExtensible public interface MockCreationSettings<T>
MockSettings
.Modifier and Type | Method and Description |
---|---|
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.
|
Answer<?> |
getDefaultAnswer()
the default answer for this mock, see
MockSettings.defaultAnswer(org.mockito.stubbing.Answer) . |
Set<Class<?>> |
getExtraInterfaces()
the extra interfaces the mock object should implement.
|
List<InvocationListener> |
getInvocationListeners()
InvocationListener instances attached to this mock, see MockSettings.invocationListeners(InvocationListener...) . |
MockName |
getMockName()
the name of this mock, as printed on verification errors; see
MockSettings.name(java.lang.String) . |
Object |
getOuterClassInstance()
Used when mocking non-static inner classes in conjunction with
isUsingConstructor() |
SerializableMode |
getSerializableMode() |
Object |
getSpiedInstance()
the spied instance - needed for spies.
|
List<StubbingLookupListener> |
getStubbingLookupListeners()
Returns
StubbingLookupListener instances attached to this mock via MockSettings.stubbingLookupListeners(StubbingLookupListener...) . |
Class<T> |
getTypeToMock()
Mocked type.
|
List<VerificationStartedListener> |
getVerificationStartedListeners()
VerificationStartedListener instances attached to this mock,
see MockSettings.verificationStartedListeners(VerificationStartedListener...) |
boolean |
isLenient()
Informs if the mock was created with "lenient" strictness, e.g.
|
boolean |
isSerializable()
if the mock is serializable, see
MockSettings.serializable() . |
boolean |
isStripAnnotations()
Whether the mock should not make a best effort to preserve annotations.
|
boolean |
isStubOnly()
Whether the mock is only for stubbing, i.e.
|
boolean |
isUsingConstructor()
Informs whether the mock instance should be created via constructor
|
Class<T> getTypeToMock()
Set<Class<?>> getExtraInterfaces()
MockName getMockName()
MockSettings.name(java.lang.String)
.Answer<?> getDefaultAnswer()
MockSettings.defaultAnswer(org.mockito.stubbing.Answer)
.Object getSpiedInstance()
boolean isSerializable()
MockSettings.serializable()
.SerializableMode getSerializableMode()
boolean isStubOnly()
boolean isStripAnnotations()
List<StubbingLookupListener> getStubbingLookupListeners()
StubbingLookupListener
instances attached to this mock via MockSettings.stubbingLookupListeners(StubbingLookupListener...)
.
The resulting list is mutable, you can add/remove listeners even after the mock was created.
For more details see StubbingLookupListener
.
List<InvocationListener> getInvocationListeners()
InvocationListener
instances attached to this mock, see MockSettings.invocationListeners(InvocationListener...)
.@Incubating List<VerificationStartedListener> getVerificationStartedListeners()
VerificationStartedListener
instances attached to this mock,
see MockSettings.verificationStartedListeners(VerificationStartedListener...)
@Incubating boolean isUsingConstructor()
@Incubating Object[] getConstructorArgs()
getOuterClassInstance()
is available, it is prepended to the passed arguments.@Incubating Object getOuterClassInstance()
isUsingConstructor()
@Incubating boolean isLenient()
Strictness.LENIENT
characteristic.
For more information about using mocks with lenient strictness, see MockSettings.lenient()
.