Class SpyOnInjectedFieldsHandler
java.lang.Object
org.mockito.internal.configuration.injection.MockInjectionStrategy
org.mockito.internal.configuration.injection.SpyOnInjectedFieldsHandler
Handler for field annotated with @InjectMocks and @Spy.
The handler assumes that field initialization AND injection already happened. So if the field is still null, then nothing will happen there.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprocessInjection(Field field, Object fieldOwner, Set<Object> mockCandidates) Process actual injection.Methods inherited from class org.mockito.internal.configuration.injection.MockInjectionStrategy
nop, process, thenTry
-
Constructor Details
-
SpyOnInjectedFieldsHandler
public SpyOnInjectedFieldsHandler()
-
-
Method Details
-
processInjection
Description copied from class:MockInjectionStrategyProcess actual injection.Don't call this method directly, instead call
MockInjectionStrategy.process(Field, Object, Set)- Specified by:
processInjectionin classMockInjectionStrategy- Parameters:
field- Field needing injectionfieldOwner- Field owner instance.mockCandidates- Pool of mocks to inject.- Returns:
trueif injection occurred,falseotherwise
-