@Test
    void referToFederationAsSearcher() {
        final Element element = parse(
                "<search>",
                "  <federation id='federationSearcher'>",
                "    <source id='mysource'>",
                "      <federationoptions optional='false' />",
                "    </source>",
                "  </federation>",

                "  <chain id='default'>",
                "    <searcher id='federationSearcher'/>",
                "  </chain>",
                "</search>");

        try {
            MockRoot root = new MockRoot();
            new DomSearchChainsBuilder().build(root.getDeployState(), root, element);
            fail("Expected exception when referring to an outer 'federation' as a 'searcher'.");
        } catch (RuntimeException e) {
            assertTrue(e.getMessage().contains("Two different types declared for the component with name 'federationSearcher'"));
        }
    }
Test of Search chains builder.

@author Tony Vaagenes
config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomSchemaChainsBuilderTest.java