Class InjectMocksScanner
java.lang.Object
org.mockito.internal.configuration.injection.scanner.InjectMocksScanner
Scan field for injection.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInjectMocksScanner
(Class<?> clazz) Create a new InjectMocksScanner for the given clazz on the given instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the fields annotated by @InjectMocks
private static void
assertNoAnnotations
(Field field, Class<? extends Annotation>... annotations) scan()
Scan fields annotated by @InjectMocks
-
Field Details
-
clazz
-
-
Constructor Details
-
InjectMocksScanner
Create a new InjectMocksScanner for the given clazz on the given instance- Parameters:
clazz
- Current class in the hierarchy of the test
-
-
Method Details
-
addTo
Add the fields annotated by @InjectMocks
- Parameters:
mockDependentFields
- Set of fields annotated by @InjectMocks
-
scan
Scan fields annotated by @InjectMocks- Returns:
- Fields that depends on Mock
-
assertNoAnnotations
-