Class InjectingAnnotationEngine
java.lang.Object
org.mockito.internal.configuration.InjectingAnnotationEngine
- All Implemented Interfaces:
AnnotationEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMockFor(Annotation annotation, Field field) Deprecated.voidinjectMocks(Object testClassInstance) Initializes mock/spies dependencies for objects annotated with @InjectMocks for given testClassInstance.voidProcess the fields of the test instance and create Mocks, Spies, Captors and inject them on fields annotated @InjectMocks.
-
Constructor Details
-
InjectingAnnotationEngine
public InjectingAnnotationEngine()
-
-
Method Details
-
createMockFor
Deprecated.Create a mock usingDefaultAnnotationEngine- Specified by:
createMockForin interfaceAnnotationEngine- Parameters:
annotation- Annotationfield- Field details- See Also:
-
process
Process the fields of the test instance and create Mocks, Spies, Captors and inject them on fields annotated @InjectMocks.This code process the test class and the super classes.
- First create Mocks, Spies, Captors.
- Then try to inject them.
- Specified by:
processin interfaceAnnotationEngine- Parameters:
clazz- Not usedtestInstance- The instance of the test, should not be null.- See Also:
-
injectMocks
Initializes mock/spies dependencies for objects annotated with @InjectMocks for given testClassInstance.See examples in javadoc for
MockitoAnnotationsclass.- Parameters:
testClassInstance- Test class, usuallythis
-