public class AnnotationEnabler
extends org.powermock.core.spi.support.AbstractPowerMockTestListenerBase
implements org.powermock.core.spi.listener.AnnotationEnablerListener
Before each test method all fields annotated with
Mock, Mock, Mock
MockNice or MockStrict will have mock objects created for
them and injected to the fields.
Also all fields annotated with TestSubject will be processed and mocks are injected to fields
object, if these fields not null.
It will only inject to fields that haven't been set before (i.e that are
null).
Mock,
Mock,
TestSubject| Constructor and Description |
|---|
AnnotationEnabler() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeTestMethod(Object testInstance,
Method method,
Object[] arguments) |
protected EasyMockAnnotationSupport |
getEasyMockAnnotationSupport(Object testInstance) |
Class<? extends Annotation>[] |
getMockAnnotations() |
afterTestMethod, afterTestSuiteEnded, beforeTestSuiteStartedpublic Class<? extends Annotation>[] getMockAnnotations()
getMockAnnotations in interface org.powermock.core.spi.listener.AnnotationEnablerListenerpublic void beforeTestMethod(Object testInstance, Method method, Object[] arguments) throws Exception
beforeTestMethod in interface org.powermock.core.spi.PowerMockTestListenerbeforeTestMethod in class org.powermock.core.spi.support.AbstractPowerMockTestListenerBaseExceptionprotected EasyMockAnnotationSupport getEasyMockAnnotationSupport(Object testInstance)
Copyright © 2007–2016. All rights reserved.