Package org.powermock.core.testlisteners
Class FieldDefaulter
java.lang.Object
org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
org.powermock.core.testlisteners.FieldDefaulter
- All Implemented Interfaces:
PowerMockTestListener
A test listener that automatically set all instance fields to their default
values after each test method. E.g. an object field is set to
null
, an int
field is set to 0 and so on.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterTestMethod
(Object testInstance, Method method, Object[] arguments, TestMethodResult testResult) Provides an empty implementation.Methods inherited from class org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
afterTestSuiteEnded, beforeTestMethod, beforeTestSuiteStarted
-
Constructor Details
-
FieldDefaulter
public FieldDefaulter()
-
-
Method Details
-
afterTestMethod
public void afterTestMethod(Object testInstance, Method method, Object[] arguments, TestMethodResult testResult) throws Exception Description copied from class:AbstractPowerMockTestListenerBase
Provides an empty implementation.- Specified by:
afterTestMethod
in interfacePowerMockTestListener
- Overrides:
afterTestMethod
in classAbstractPowerMockTestListenerBase
method
- The test method that is currently executed.arguments
- The arguments passed to the test method if any. May be an empty array but nevernull
.testResult
- The outcome of the test method.- Throws:
Exception
- If something unexpected occurs.
-