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"));
}
Aggregations