public class AnnotationEnabler
extends org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
implements org.powermock.core.spi.listener.AnnotationEnablerListener
Mock
,
MockNice
or MockStrict
will have mock objects created for
them and injected to the fields.
It will only inject to fields that haven't been set before (i.e that are
null
).
Modifier and Type | Class and Description |
---|---|
protected class |
AnnotationEnabler.FieldInjector |
Constructor and Description |
---|
AnnotationEnabler() |
Modifier and Type | Method and Description |
---|---|
void |
beforeTestMethod(Object testInstance,
Method method,
Object[] arguments) |
Class<? extends Annotation>[] |
getMockAnnotations() |
protected void |
injectDefaultMocks(Object testInstance) |
protected void |
injectNiceMocks(Object testInstance) |
protected void |
injectStrictMocks(Object testInstance) |
afterTestMethod, afterTestSuiteEnded, beforeTestSuiteStarted
public void beforeTestMethod(Object testInstance, Method method, Object[] arguments) throws Exception
beforeTestMethod
in interface org.powermock.core.spi.PowerMockTestListener
beforeTestMethod
in class org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
Exception
protected void injectStrictMocks(Object testInstance) throws Exception
Exception
protected void injectNiceMocks(Object testInstance) throws Exception
Exception
protected void injectDefaultMocks(Object testInstance) throws Exception
Exception
public Class<? extends Annotation>[] getMockAnnotations()
getMockAnnotations
in interface org.powermock.core.spi.listener.AnnotationEnablerListener
Copyright © 2007–2015. All rights reserved.