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 field,
java.lang.Object fieldOwner,
java.util.Set<java.lang.Object> mockCandidates)
Process actual injection.
|
nop, process, thenTry
public boolean processInjection(java.lang.reflect.Field field, java.lang.Object fieldOwner, java.util.Set<java.lang.Object> mockCandidates)
MockInjectionStrategy
Don't call this method directly, instead call MockInjectionStrategy.process(Field, Object, Set)
processInjection
in class MockInjectionStrategy
field
- Field needing injectionfieldOwner
- Field owner instance.mockCandidates
- Pool of mocks to inject.true
if injection occurred, false
otherwise