@Override
    public void getConfig(FederationConfig.Builder builder) {
        for (Target target : resolvedTargets.values())
            builder.target(target.getTargetConfig());

        targetSelector.ifPresent(selector -> builder.targetSelector(selector.getGlobalComponentId().stringValue()));
    }
@Test
    void leaders_must_be_the_first_search_chain_in_a_target() throws Exception {
        FederationFixture f = new ProvidersWithSourceFixture();

        FederationConfig federationConfig = getConfig(f.federationSearchWithDefaultSources);
        List<FederationConfig.Target.SearchChain> searchChain = federationConfig.target(0).searchChain();

        assertEquals("provider1", searchChain.get(0).providerId());
        assertEquals("provider2", searchChain.get(1).providerId());
    }