Class InjectingAnnotationEngine
java.lang.Object
org.mockito.internal.configuration.InjectingAnnotationEngine
- All Implemented Interfaces:
AnnotationEngine
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mockito.plugins.AnnotationEngine
AnnotationEngine.NoAction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
injectMocks
(Object testClassInstance) Deprecated.protected void
onInjection
(Object testClassInstance, Class<?> clazz, Set<Field> mockDependentFields, Set<Object> mocks) Process 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
-
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:
process
in interfaceAnnotationEngine
- Parameters:
clazz
- Not usedtestInstance
- The instance of the test, should not be null.- See Also:
-
injectMocks
Deprecated.UseinjectCloseableMocks(Object)
.Required by PowerMockito and retained to avoid API breakage despite being internal API. -
onInjection
-
injectCloseableMocks(Object)
.