Package org.mockito.internal.listeners
Class VerificationStartedNotifier.Event
- java.lang.Object
-
- org.mockito.internal.listeners.VerificationStartedNotifier.Event
-
- All Implemented Interfaces:
VerificationStartedEvent
- Enclosing class:
- VerificationStartedNotifier
static class VerificationStartedNotifier.Event extends java.lang.Object implements VerificationStartedEvent
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
mock
private MockingDetails
originalMockingDetails
-
Constructor Summary
Constructors Constructor Description Event(MockingDetails originalMockingDetails)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getMock()
The mock object that will be used during verification.void
setMock(java.lang.Object mock)
Replaces existing mock object for verification with a different one.
-
-
-
Field Detail
-
originalMockingDetails
private final MockingDetails originalMockingDetails
-
mock
private java.lang.Object mock
-
-
Constructor Detail
-
Event
public Event(MockingDetails originalMockingDetails)
-
-
Method Detail
-
setMock
public void setMock(java.lang.Object mock)
Description copied from interface:VerificationStartedEvent
Replaces existing mock object for verification with a different one. Needed for very advanced framework integrations. For all the details, including how and why seeVerificationStartedListener
.If this method is used to replace the mock the sibling method
VerificationStartedEvent.getMock()
will return the new value. CAVEAT: ifsetMock(Object)
is invoked multiple times from one or many listeners the sibling methodVerificationStartedEvent.getMock()
will return mock that was set by most recent invocation ofsetMock(Object)
.- Specified by:
setMock
in interfaceVerificationStartedEvent
- Parameters:
mock
- to be used for verification.
-
getMock
public java.lang.Object getMock()
Description copied from interface:VerificationStartedEvent
The mock object that will be used during verification. See sibling methodVerificationStartedEvent.setMock(Object)
for more details. Please seeVerificationStartedListener
for all details of verification started listeners.- Specified by:
getMock
in interfaceVerificationStartedEvent
-
-