Package org.mockito.internal.junit
Class UniversalTestListener
java.lang.Object
org.mockito.internal.junit.UniversalTestListener
- All Implemented Interfaces:
MockitoTestListener,AutoCleanableListener,MockCreationListener,MockitoListener
public class UniversalTestListener
extends Object
implements MockitoTestListener, AutoCleanableListener
Universal test listener that behaves accordingly to current setting of strictness.
Will come handy when we offer tweaking strictness at the method level with annotation.
Should be relatively easy to improve and offer tweaking strictness per mock.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidonMockCreated(Object mock, MockCreationSettings settings) Mock object was just created.voidMarks listener as dirty, scheduled for cleanup when the next session startsvoidsetStrictness(Strictness strictness) voidtestFinished(TestFinishedEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mockito.listeners.MockCreationListener
onStaticMockCreated
-
Constructor Details
-
UniversalTestListener
-
-
Method Details
-
testFinished
- Specified by:
testFinishedin interfaceMockitoTestListener
-
onMockCreated
Description copied from interface:MockCreationListenerMock object was just created.- Specified by:
onMockCreatedin interfaceMockCreationListener- Parameters:
mock- created mock objectsettings- the settings used for creation
-
setStrictness
-
isListenerDirty
public boolean isListenerDirty()- Specified by:
isListenerDirtyin interfaceAutoCleanableListener
-
setListenerDirty
public void setListenerDirty()Marks listener as dirty, scheduled for cleanup when the next session starts
-