|Constructor and Description|
|Modifier and Type||Method and Description|
NOP Strategy that will always try the next strategy.
Actually inject mockCandidates on field.
Process actual injection.
Enqueue next injection strategy.
public static final MockInjectionStrategy nop()
public MockInjectionStrategy thenTry(MockInjectionStrategy strategy)
The implementation should take care of the actual calling if required.
strategy- Queued strategy.
Actual algorithm is defined in the implementations of
processInjection(Field, Object, Set).
However if injection occurred successfully, the process should return
The code takes care of calling the next strategy if available and if of course if required
onField- Field needing injection.
fieldOwnedBy- The owning instance of the field.
mockCandidates- A set of mock candidate, that might be injected.
protected abstract boolean processInjection(Field field, Object fieldOwner, Set<Object> mockCandidates)
Don't call this method directly, instead call
process(Field, Object, Set)
field- Field needing injection
fieldOwner- Field owner instance.
mockCandidates- Pool of mocks to inject.
trueif injection occurred,