public class CreationSettings<T> extends java.lang.Object implements MockCreationSettings<T>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected Answer<java.lang.Object> |
defaultAnswer |
protected java.util.Set<java.lang.Class> |
extraInterfaces |
protected java.util.List<InvocationListener> |
invocationListeners |
protected MockName |
mockName |
protected java.lang.String |
name |
protected SerializableMode |
serializableMode |
protected java.lang.Object |
spiedInstance |
protected boolean |
stubOnly |
protected java.lang.Class<T> |
typeToMock |
Constructor and Description |
---|
CreationSettings() |
CreationSettings(CreationSettings copy) |
Modifier and Type | Method and Description |
---|---|
Answer<java.lang.Object> |
getDefaultAnswer()
the default answer for this mock, see
MockSettings.defaultAnswer(org.mockito.stubbing.Answer) . |
java.util.Set<java.lang.Class> |
getExtraInterfaces()
the extra interfaces the mock object should implement.
|
java.util.List<InvocationListener> |
getInvocationListeners()
The invocation listeners attached to this mock, see
MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...) . |
MockName |
getMockName()
the name of this mock, as printed on verification errors; see
MockSettings.name(java.lang.String) . |
java.lang.String |
getName() |
java.lang.Object |
getOuterClassInstance()
Used when mocking non-static inner classes in conjunction with
MockCreationSettings.isUsingConstructor() |
SerializableMode |
getSerializableMode() |
java.lang.Object |
getSpiedInstance()
the spied instance - needed for spies.
|
java.lang.Class<T> |
getTypeToMock()
Mocked type.
|
boolean |
isSerializable()
if the mock is serializable, see
MockSettings.serializable() . |
boolean |
isStubOnly()
Whether the mock is only for stubbing, i.e.
|
boolean |
isUsingConstructor()
Informs whether the mock instance should be created via constructor
|
CreationSettings<T> |
setExtraInterfaces(java.util.Set<java.lang.Class> extraInterfaces) |
CreationSettings<T> |
setMockName(MockName mockName) |
CreationSettings<T> |
setTypeToMock(java.lang.Class<T> typeToMock) |
protected java.lang.Class<T> typeToMock
protected java.util.Set<java.lang.Class> extraInterfaces
protected java.lang.String name
protected java.lang.Object spiedInstance
protected Answer<java.lang.Object> defaultAnswer
protected MockName mockName
protected SerializableMode serializableMode
protected java.util.List<InvocationListener> invocationListeners
protected boolean stubOnly
public CreationSettings()
public CreationSettings(CreationSettings copy)
public java.lang.Class<T> getTypeToMock()
MockCreationSettings
getTypeToMock
in interface MockCreationSettings<T>
public CreationSettings<T> setTypeToMock(java.lang.Class<T> typeToMock)
public java.util.Set<java.lang.Class> getExtraInterfaces()
MockCreationSettings
getExtraInterfaces
in interface MockCreationSettings<T>
public CreationSettings<T> setExtraInterfaces(java.util.Set<java.lang.Class> extraInterfaces)
public java.lang.String getName()
public java.lang.Object getSpiedInstance()
MockCreationSettings
getSpiedInstance
in interface MockCreationSettings<T>
public Answer<java.lang.Object> getDefaultAnswer()
MockCreationSettings
MockSettings.defaultAnswer(org.mockito.stubbing.Answer)
.getDefaultAnswer
in interface MockCreationSettings<T>
public MockName getMockName()
MockCreationSettings
MockSettings.name(java.lang.String)
.getMockName
in interface MockCreationSettings<T>
public CreationSettings<T> setMockName(MockName mockName)
public boolean isSerializable()
MockCreationSettings
MockSettings.serializable()
.isSerializable
in interface MockCreationSettings<T>
public SerializableMode getSerializableMode()
getSerializableMode
in interface MockCreationSettings<T>
public java.util.List<InvocationListener> getInvocationListeners()
MockCreationSettings
MockSettings.invocationListeners(org.mockito.listeners.InvocationListener...)
.getInvocationListeners
in interface MockCreationSettings<T>
public boolean isUsingConstructor()
MockCreationSettings
isUsingConstructor
in interface MockCreationSettings<T>
public java.lang.Object getOuterClassInstance()
MockCreationSettings
MockCreationSettings.isUsingConstructor()
getOuterClassInstance
in interface MockCreationSettings<T>
public boolean isStubOnly()
MockCreationSettings
isStubOnly
in interface MockCreationSettings<T>