GenericServicesModel extends ConfigModel { public List<ServiceCluster> serviceClusters() { return clusters; } GenericServicesModel(ConfigModelContext modelContext); void addCluster(ServiceCluster cluster); List<ServiceCluster> serviceClusters();  }
@Test public void test_generic_services_parsing() throws IOException, SAXException { final String hosts = "<hosts>" + "<host name=\"localhost\">" + " <alias>mockhost</alias>" + " </host> " + "</hosts>"; String services = "<services version=\"1.0\">" + "<service id=\"me\" name=\"foo\" command=\"/bin/bar\" version=\"1.0\">" + "<node hostalias=\"mockhost\" />" + "</service>" + "</services>"; VespaModel model = new VespaModel(new MockApplicationPackage.Builder().withHosts(hosts).withServices(services).build()); GenericServicesModel gsModel = (GenericServicesModel) model.configModelRepo().get("me"); assertThat(gsModel.serviceClusters().size(), is(1)); assertThat(gsModel.serviceClusters().get(0).getName(), is("foo")); assertThat(gsModel.serviceClusters().get(0).services().size(), is(1)); }