public class PropertyAndSetterInjection extends MockInjectionStrategy
Algorithm :
for each field annotated by @InjectMocks
Note: If the field needing injection is not initialized, the strategy tries to create one using a no-arg constructor of the field type.
| Constructor and Description |
|---|
PropertyAndSetterInjection() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
processInjection(java.lang.reflect.Field injectMocksField,
java.lang.Object injectMocksFieldOwner,
java.util.Set<java.lang.Object> mockCandidates)
Process actual injection.
|
nop, process, thenTrypublic boolean processInjection(java.lang.reflect.Field injectMocksField,
java.lang.Object injectMocksFieldOwner,
java.util.Set<java.lang.Object> mockCandidates)
MockInjectionStrategy
Don't call this method directly, instead call MockInjectionStrategy.process(Field, Object, Set)
processInjection in class MockInjectionStrategyinjectMocksField - Field needing injectioninjectMocksFieldOwner - Field owner instance.mockCandidates - Pool of mocks to inject.true if injection occurred, false otherwise