Class IndependentAnnotationEngine
java.lang.Object
org.mockito.internal.configuration.IndependentAnnotationEngine
- All Implemented Interfaces:
AnnotationEngine
Initializes fields annotated with @
Mock
or @Captor
.
The process(Class, Object)
method implementation does not process super classes!
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mockito.plugins.AnnotationEngine
AnnotationEngine.NoAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<Class<? extends Annotation>, FieldAnnotationProcessor<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Object
createMockFor
(Annotation annotation, Field field) private <A extends Annotation>
FieldAnnotationProcessor<A> forAnnotation
(A annotation) Processes the test instance to configure annotated members.private <A extends Annotation>
voidregisterAnnotationProcessor
(Class<A> annotationClass, FieldAnnotationProcessor<A> fieldAnnotationProcessor) (package private) void
throwIfAlreadyAssigned
(Field field, boolean alreadyAssigned)
-
Field Details
-
annotationProcessorMap
-
-
Constructor Details
-
IndependentAnnotationEngine
public IndependentAnnotationEngine()
-
-
Method Details
-
createMockFor
-
forAnnotation
-
registerAnnotationProcessor
private <A extends Annotation> void registerAnnotationProcessor(Class<A> annotationClass, FieldAnnotationProcessor<A> fieldAnnotationProcessor) -
process
Description copied from interface:AnnotationEngine
Processes the test instance to configure annotated members.- Specified by:
process
in interfaceAnnotationEngine
- Parameters:
clazz
- Class where to extract field information, check implementation for detailstestInstance
- Test instance
-
throwIfAlreadyAssigned
-