@Test
    void cluster_with_zookeeper() {
        Function<Integer, String> servicesXml = (nodeCount) -> "<container version='1.0' id='default'>" +
                "<nodes count='" + nodeCount + "'/>" +
                "<zookeeper session-timeout-seconds='30'/>" +
                "</container>";
        VespaModelTester tester = new VespaModelTester();
        tester.addHosts(3);
        {
            VespaModel model = tester.createModel(servicesXml.apply(3), true);
            ApplicationContainerCluster cluster = model.getContainerClusters().get("default");
            assertNotNull(cluster);
            assertComponentConfigured(cluster, "com.yahoo.vespa.curator.Curator");
            assertComponentConfigured(cluster, "com.yahoo.vespa.curator.CuratorWrapper");
            assertEquals(30, model.getConfig(CuratorConfig.class, cluster.getConfigId()).zookeeperSessionTimeoutSeconds());
            cluster.getContainers().forEach(container -> {
                assertComponentConfigured(container, "com.yahoo.vespa.zookeeper.ReconfigurableVespaZooKeeperServer");
                assertComponentConfigured(container, "com.yahoo.vespa.zookeeper.Reconfigurer");
                assertComponentConfigured(container, "com.yahoo.vespa.zookeeper.VespaZooKeeperAdminImpl");

                ZookeeperServerConfig config = model.getConfig(ZookeeperServerConfig.class, container.getConfigId());
                assertEquals(container.index(), config.myid());
                assertEquals(3, config.server().size());
            });
        }
        {
            try {
                tester.createModel(servicesXml.apply(2), true);
                fail("Expected exception");
            } catch (IllegalArgumentException ignored) {
            }
        }
        {
            String xmlWithNodes =
                    "<?xml version='1.0' encoding='utf-8' ?>" +
                            "<services>" +
                            "  <container version='1.0' id='container1'>" +
                            "     <zookeeper/>" +
                            "     <nodes of='content1'/>" +
                            "  </container>" +
                            "  <content version='1.0' id='content1'>" +
                            "     <nodes count='3'/>" +
                            "   </content>" +
                            "</services>";
            try {
                tester.createModel(xmlWithNodes, true);
                fail("Expected exception");
            } catch (IllegalArgumentException ignored) {
            }
        }
    }
Tests for "core functionality" of the container model, e.g. ports, or the 'components' and 'bundles' configs.

Before adding a new test to this class, check if the test fits into one of the other existing subclasses
of {@link ContainerModelBuilderTestBase}. If not, consider creating a new subclass.

@author gjoranv
config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java