// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.content; import com.yahoo.vespa.config.content.StorFilestorConfig; import com.yahoo.vespa.model.VespaModel; import com.yahoo.vespa.model.content.cluster.ContentCluster; import com.yahoo.vespa.model.content.storagecluster.StorageCluster; import com.yahoo.vespa.model.test.utils.ApplicationPackageUtils; import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author gjoranv * @since 5.1.8 */ public class GenericConfigTest { private VespaModel model; private String servicesXml() { return "" + "" + " " + " 7 " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " \n" + " " + " " + " 1024" + " " + " 1" + " " + " " + " " + " " + ""; } @BeforeEach public void getVespaModel() { model = (new VespaModelCreatorWithMockPkg(ContentBaseTest.getHosts(), servicesXml(), ApplicationPackageUtils.generateSchemas("type1"))).create(); } @Test void config_override_on_root_is_visible_on_storage_cluster() { StorageCluster cluster = model.getContentClusters().get("storage").getStorageCluster(); StorFilestorConfig config = model.getConfig(StorFilestorConfig.class, cluster.getConfigId()); assertEquals(7, config.num_threads()); } @Test void config_override_on_root_is_visible_on_content_cluster() { ContentCluster cluster = model.getContentClusters().get("storage"); StorFilestorConfig config = model.getConfig(StorFilestorConfig.class, cluster.getConfigId()); assertEquals(7, config.num_threads()); } }