@Test public void manually_specified_targets_overrides_inherited_targets() throws Exception { FederationFixture f = new FederationFixture(); f.registerProviderWithSources(createProvider(ComponentId.fromString("provider1"))); FederationSearcher federation = newFederationSearcher(true, singletonList(new TargetSpec(ComponentSpecification.fromString("provider1"), new FederationOptions().setTimeoutInMilliseconds(12345)))); f.initializeFederationSearcher(federation); FederationConfig federationConfig = getConfig(federation); assertEquals(1, federationConfig.target().size()); FederationConfig.Target target = federationConfig.target(0); assertEquals(1, target.searchChain().size()); FederationConfig.Target.SearchChain searchChain = target.searchChain(0); assertEquals(12345, searchChain.timeoutMillis()); }
@Override public void getConfig(FederationConfig.Builder builder) { for (Target target : resolvedTargets.values()) { builder.target(target.getTargetConfig()); } if (targetSelector.isPresent()) { builder.targetSelector(targetSelector.get().getGlobalComponentId().stringValue()); } }
FederationSearcher extends Searcher<FederationSearcherModel> implements FederationConfig.Producer { @Override public void getConfig(FederationConfig.Builder builder) { for (Target target : resolvedTargets.values()) { builder.target(target.getTargetConfig()); } if (targetSelector.isPresent()) { builder.targetSelector(targetSelector.get().getGlobalComponentId().stringValue()); } } }
FederationSearcher extends Searcher<FederationSearcherModel> implements FederationConfig.Producer { @Override public void getConfig(FederationConfig.Builder builder) { for (Target target : resolvedTargets.values()) { builder.target(target.getTargetConfig()); } if (targetSelector.isPresent()) { builder.targetSelector(targetSelector.get().getGlobalComponentId().stringValue()); } } FederationSearcher(FederationSearcherModel searcherModel, Optional<Component> targetSelector); }
FederationSearcher extends Searcher<FederationSearcherModel> implements FederationConfig.Producer { @Override public void getConfig(FederationConfig.Builder builder) { for (Target target : resolvedTargets.values()) { builder.target(target.getTargetConfig()); } if (targetSelector.isPresent()) { builder.targetSelector(targetSelector.get().getGlobalComponentId().stringValue()); } } FederationSearcher(FederationSearcherModel searcherModel, Optional<Component> targetSelector); @Override void getConfig(FederationConfig.Builder builder); @Override void initialize(); }
FederationSearcher extends Searcher<FederationSearcherModel> implements FederationConfig.Producer { @Override public void getConfig(FederationConfig.Builder builder) { for (Target target : resolvedTargets.values()) { builder.target(target.getTargetConfig()); } if (targetSelector.isPresent()) { builder.targetSelector(targetSelector.get().getGlobalComponentId().stringValue()); } } FederationSearcher(FederationSearcherModel searcherModel, Optional<Component> targetSelector); @Override void getConfig(FederationConfig.Builder builder); @Override void initialize();  }