Search in sources :

Example 6 with TestRoot

use of com.yahoo.config.model.test.TestRoot in project vespa by vespa-engine.

the class AdminTestCase method testTenantAndAppInSentinelConfig.

@Test
public void testTenantAndAppInSentinelConfig() {
    DeployState state = new DeployState.Builder().zone(new Zone(Environment.dev, RegionName.from("baz"))).properties(new DeployProperties.Builder().applicationId(new ApplicationId.Builder().tenant("quux").applicationName("foo").instanceName("bim").build()).build()).build(true);
    TestRoot root = new TestDriver().buildModel(state);
    String localhost = HostName.getLocalhost();
    SentinelConfig config = root.getConfig(SentinelConfig.class, "hosts/" + localhost);
    assertThat(config.application().tenant(), is("quux"));
    assertThat(config.application().name(), is("foo"));
    assertThat(config.application().environment(), is("dev"));
    assertThat(config.application().region(), is("baz"));
    assertThat(config.application().instance(), is("bim"));
}
Also used : DeployState(com.yahoo.config.model.deploy.DeployState) SentinelConfig(com.yahoo.cloud.config.SentinelConfig) Zone(com.yahoo.config.provision.Zone) TestRoot(com.yahoo.config.model.test.TestRoot) TestDriver(com.yahoo.config.model.test.TestDriver) Test(org.junit.Test)

Aggregations

TestDriver (com.yahoo.config.model.test.TestDriver)6 TestRoot (com.yahoo.config.model.test.TestRoot)6 Test (org.junit.Test)5 SentinelConfig (com.yahoo.cloud.config.SentinelConfig)2 DeployState (com.yahoo.config.model.deploy.DeployState)2 Zone (com.yahoo.config.provision.Zone)2 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 RankProfilesConfig (com.yahoo.vespa.config.search.RankProfilesConfig)1 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)1 File (java.io.File)1