public class CreationSettings<T> extends Object implements MockCreationSettings<T>, Serializable
Modifier and Type | Field and Description |
---|---|
protected Answer<Object> |
defaultAnswer |
protected Set<Class> |
extraInterfaces |
protected List<InvocationListener> |
invocationListeners |
protected MockName |
mockName |
protected String |
name |
protected SerializableMode |
serializableMode |
protected Object |
spiedInstance |
protected boolean |
stubOnly |
protected Class<T> |
typeToMock |
Constructor and Description |
---|
CreationSettings() |
CreationSettings(CreationSettings copy) |
Modifier and Type | Method and Description |
---|---|
Answer<Object> |
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()
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) . |
String |
getName() |
Object |
getOuterClassInstance()
Used when mocking non-static inner classes in conjunction with
MockCreationSettings.isUsingConstructor() |
SerializableMode |
getSerializableMode() |
Object |
getSpiedInstance()
the spied instance - needed for spies.
|
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(Set<Class> extraInterfaces) |
CreationSettings<T> |
setMockName(MockName mockName) |
CreationSettings<T> |
setTypeToMock(Class<T> typeToMock) |
protected String name
protected Object spiedInstance
protected MockName mockName
protected SerializableMode serializableMode
protected List<InvocationListener> invocationListeners
protected boolean stubOnly
public CreationSettings()
public CreationSettings(CreationSettings copy)
public Class<T> getTypeToMock()
MockCreationSettings
getTypeToMock
in interface MockCreationSettings<T>
public CreationSettings<T> setTypeToMock(Class<T> typeToMock)
public Set<Class> getExtraInterfaces()
MockCreationSettings
getExtraInterfaces
in interface MockCreationSettings<T>
public CreationSettings<T> setExtraInterfaces(Set<Class> extraInterfaces)
public String getName()
public Object getSpiedInstance()
MockCreationSettings
getSpiedInstance
in interface MockCreationSettings<T>
public Answer<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 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 Object getOuterClassInstance()
MockCreationSettings
MockCreationSettings.isUsingConstructor()
getOuterClassInstance
in interface MockCreationSettings<T>
public boolean isStubOnly()
MockCreationSettings
isStubOnly
in interface MockCreationSettings<T>
Mockito, MIT License