@Test public void resolve_finderReturnsStrategy_callResolveOnStrategy() { LookupContext context = mock(LookupContext.class); ResolveStrategy strategy = mockStrategy(context); sut.resolve(context); verify(strategy).resolve(context); }
@Override public Collection<SagaInstanceInfo> resolve(final LookupContext context) { Collection<SagaInstanceInfo> allInstances = new ArrayList<>(); Collection<ResolveStrategy> resolveStrategies = strategyFinder.find(context); for (ResolveStrategy strategy : resolveStrategies) { Collection<SagaInstanceInfo> resolvedInstances = strategy.resolve(context); allInstances.addAll(resolvedInstances); } return allInstances; }
StrategyInstanceResolver implements InstanceResolver { @Override public Collection<SagaInstanceInfo> resolve(final LookupContext context) { Collection<SagaInstanceInfo> allInstances = new ArrayList<>(); Collection<ResolveStrategy> resolveStrategies = strategyFinder.find(context); for (ResolveStrategy strategy : resolveStrategies) { Collection<SagaInstanceInfo> resolvedInstances = strategy.resolve(context); allInstances.addAll(resolvedInstances); } return allInstances; } }
StrategyInstanceResolver implements InstanceResolver { @Override public Collection<SagaInstanceInfo> resolve(final LookupContext context) { Collection<SagaInstanceInfo> allInstances = new ArrayList<>(); Collection<ResolveStrategy> resolveStrategies = strategyFinder.find(context); for (ResolveStrategy strategy : resolveStrategies) { Collection<SagaInstanceInfo> resolvedInstances = strategy.resolve(context); allInstances.addAll(resolvedInstances); } return allInstances; } @Inject  StrategyInstanceResolver(final StrategyFinder strategyFinder); }
StrategyInstanceResolver implements InstanceResolver { @Override public Collection<SagaInstanceInfo> resolve(final LookupContext context) { Collection<SagaInstanceInfo> allInstances = new ArrayList<>(); Collection<ResolveStrategy> resolveStrategies = strategyFinder.find(context); for (ResolveStrategy strategy : resolveStrategies) { Collection<SagaInstanceInfo> resolvedInstances = strategy.resolve(context); allInstances.addAll(resolvedInstances); } return allInstances; } @Inject  StrategyInstanceResolver(final StrategyFinder strategyFinder); @Override Collection<SagaInstanceInfo> resolve(final LookupContext context); }
StrategyInstanceResolver implements InstanceResolver { @Override public Collection<SagaInstanceInfo> resolve(final LookupContext context) { Collection<SagaInstanceInfo> allInstances = new ArrayList<>(); Collection<ResolveStrategy> resolveStrategies = strategyFinder.find(context); for (ResolveStrategy strategy : resolveStrategies) { Collection<SagaInstanceInfo> resolvedInstances = strategy.resolve(context); allInstances.addAll(resolvedInstances); } return allInstances; } @Inject  StrategyInstanceResolver(final StrategyFinder strategyFinder); @Override Collection<SagaInstanceInfo> resolve(final LookupContext context);  }