diff options
author | bjormel <bjormel@yahooinc.com> | 2023-10-26 13:59:28 +0000 |
---|---|---|
committer | bjormel <bjormel@yahooinc.com> | 2023-10-26 13:59:28 +0000 |
commit | 567be9a1f6353cec41c23bfd1fcd46b4b2a4d2d7 (patch) | |
tree | 4664a743e166a5e11aee7b9acd70ad8ee2617612 /config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java | |
parent | e9058b555d4dfea2f6c872d9a677e8678b569569 (diff) | |
parent | bce3b8e926bf9da880172acbe1ba4b12d5e026d6 (diff) |
Merge branch 'master' into bjormel/aws-main-controllerbjormel/aws-main-controller
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java index 998e19794fc..4c5f20a4e2f 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/test/ModelAmendingTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.test; import com.yahoo.component.ComponentId; @@ -7,10 +7,13 @@ import com.yahoo.config.model.ConfigModelContext; import com.yahoo.config.model.ConfigModelRegistry; import com.yahoo.config.model.MapConfigModelRegistry; import com.yahoo.config.model.admin.AdminModel; +import com.yahoo.config.model.api.ApplicationClusterEndpoint; +import com.yahoo.config.model.api.ContainerEndpoint; import com.yahoo.config.model.builder.xml.ConfigModelBuilder; import com.yahoo.config.model.builder.xml.ConfigModelId; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.TreeConfigProducer; +import com.yahoo.config.provision.Zone; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.model.AbstractService; import com.yahoo.vespa.model.HostResource; @@ -26,8 +29,11 @@ import org.w3c.dom.Element; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * Demonstrates how a model can be added at build time to amend another model. @@ -73,7 +79,9 @@ public class ModelAmendingTestCase { "</services>"; VespaModelTester tester = new VespaModelTester(amendingModelRepo); tester.addHosts(12); - VespaModel model = tester.createModel(services); + DeployState.Builder builder = new DeployState.Builder().endpoints(Set.of(new ContainerEndpoint("test1", ApplicationClusterEndpoint.Scope.zone, List.of("t1.example.com")), + new ContainerEndpoint("test2", ApplicationClusterEndpoint.Scope.zone, List.of("t2.example.com")))); + VespaModel model = tester.createModel(Zone.defaultZone(), services, true, builder); // Check that all hosts are amended for (HostResource host : model.getAdmin().hostSystem().getHosts()) { @@ -120,7 +128,9 @@ public class ModelAmendingTestCase { "</services>"; VespaModelTester tester = new VespaModelTester(amendingModelRepo); tester.addHosts(12); - VespaModel model = tester.createModel(services); + DeployState.Builder builder = new DeployState.Builder().endpoints(Set.of(new ContainerEndpoint("test1", ApplicationClusterEndpoint.Scope.zone, List.of("t1.example.com")), + new ContainerEndpoint("test2", ApplicationClusterEndpoint.Scope.zone, List.of("t2.example.com")))); + VespaModel model = tester.createModel(Zone.defaultZone(), services, true, builder); // Check that all hosts are amended for (HostResource host : model.getAdmin().hostSystem().getHosts()) { |