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
public class FieldDefaulter extends AbstractPowerMockTestListenerBase
A test listener that automatically set all instance fields to their default values after each test method. E.g. an object field is set tonull, anintfield is set to 0 and so on.
-
-
Constructor Summary
Constructors Constructor Description FieldDefaulter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterTestMethod(java.lang.Object testInstance, java.lang.reflect.Method method, java.lang.Object[] arguments, TestMethodResult testResult)Provides an empty implementation.-
Methods inherited from class org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
afterTestSuiteEnded, beforeTestMethod, beforeTestSuiteStarted
-
-
-
-
Method Detail
-
afterTestMethod
public void afterTestMethod(java.lang.Object testInstance, java.lang.reflect.Method method, java.lang.Object[] arguments, TestMethodResult testResult) throws java.lang.ExceptionDescription copied from class:AbstractPowerMockTestListenerBaseProvides an empty implementation.- Specified by:
afterTestMethodin interfacePowerMockTestListener- Overrides:
afterTestMethodin classAbstractPowerMockTestListenerBasemethod- 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:
java.lang.Exception- If something unexpected occurs.
-
-