use of com.yahoo.cloud.config.LbServicesConfig in project vespa by vespa-engine.
the class LbServicesProducerTest method testConfigAliasesWithRotations.
@Test
public void testConfigAliasesWithRotations() throws IOException, SAXException {
Map<TenantName, Map<ApplicationId, ApplicationInfo>> testModel = createTestModel(new DeployState.Builder().rotations(rotations));
RegionName regionName = RegionName.from("us-east-1");
LbServicesConfig conf = getLbServicesConfig(new Zone(Environment.prod, regionName), testModel);
final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").hosts("foo.foo.yahoo.com").services("qrserver");
assertThat(services.servicealiases().size(), is(1));
assertThat(services.endpointaliases().size(), is(4));
assertThat(services.servicealiases(0), is("service1"));
assertThat(services.endpointaliases(0), is("foo1.bar1.com"));
assertThat(services.endpointaliases(1), is("foo2.bar2.com"));
assertThat(services.endpointaliases(2), is(rotation1));
assertThat(services.endpointaliases(3), is(rotation2));
}
Aggregations