|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mockito.internal.configuration.SpyAnnotationEngine
public class SpyAnnotationEngine
Process fields annotated with @Spy.
Will try transform the field in a spy as with Mockito.spy()
.
If the field is not initialized, will try to initialize it, with a no-arg constructor.
If the field is also annotated with the compatible @InjectMocks then the field will be ignored, The injection engine will handle this specific case.
This engine will fail, if the field is also annotated with incompatible Mockito annotations.
Constructor Summary | |
---|---|
SpyAnnotationEngine()
|
Method Summary | |
---|---|
java.lang.Object |
createMockFor(java.lang.annotation.Annotation annotation,
java.lang.reflect.Field field)
|
void |
process(java.lang.Class<?> context,
java.lang.Object testInstance)
Allows extending the interface to perform action on specific fields on the test class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpyAnnotationEngine()
Method Detail |
---|
public java.lang.Object createMockFor(java.lang.annotation.Annotation annotation, java.lang.reflect.Field field)
createMockFor
in interface AnnotationEngine
annotation
- Annotationfield
- Field detailspublic void process(java.lang.Class<?> context, java.lang.Object testInstance)
AnnotationEngine
See the implementation of this method to figure out what is it for.
process
in interface AnnotationEngine
context
- Class where to extract field information, check implementation for detailstestInstance
- Test instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |