diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-12-16 13:32:13 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-12-16 13:32:13 +0100 |
commit | 276121efb65afb8d5c6989929f197b136cd85761 (patch) | |
tree | d0f8d3a922be5e1be987e5eb397aa28b1ca2ce79 | |
parent | 2d06a59a788b1f910e492a0aec8725a83d1f1411 (diff) |
Verify config instead of depending on method in ClusterControllerContainer
2 files changed, 8 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java index 10f9565e981..d7223018b73 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java @@ -84,7 +84,7 @@ public class ClusterControllerContainer extends Container implements return ContainerServiceType.CLUSTERCONTROLLER_CONTAINER; } - public String zooKeeperServerImplementation(boolean runStandaloneZooKeeper, boolean reconfigurable) { + private String zooKeeperServerImplementation(boolean runStandaloneZooKeeper, boolean reconfigurable) { if (reconfigurable) return "com.yahoo.vespa.zookeeper.ReconfigurableVespaZooKeeperServer"; else diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java index d0231ee4278..a55d221f8c4 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java @@ -10,6 +10,7 @@ import com.yahoo.config.model.test.TestRoot; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.Zone; +import com.yahoo.container.ComponentsConfig; import com.yahoo.messagebus.routing.RoutingTableSpec; import com.yahoo.metrics.MetricsmanagerConfig; import com.yahoo.vespa.config.content.AllClustersBucketSpacesConfig; @@ -1001,7 +1002,12 @@ public class ContentClusterTest extends ContentBaseTest { ContentCluster cc = model.getContentClusters().get("storage"); for (ClusterControllerContainer c : cc.getClusterControllers().getContainers()) { - assertEquals(expectedClassName, c.zooKeeperServerImplementation(true, reconfigurable)); + var builder = new ComponentsConfig.Builder(); + c.getConfig(builder); + assertEquals(1, new ComponentsConfig(builder).components().stream() + .filter(component -> component.id().equals("clustercontroller-zookeeper-server")) + .map(component -> component.classId().equals(expectedClassName)) + .count()); } } |