Search in sources :

Example 6 with LbServicesConfig

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));
}
Also used : RegionName(com.yahoo.config.provision.RegionName) TenantName(com.yahoo.config.provision.TenantName) Zone(com.yahoo.config.provision.Zone) LbServicesConfig(com.yahoo.cloud.config.LbServicesConfig) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Test(org.junit.Test)

Aggregations

LbServicesConfig (com.yahoo.cloud.config.LbServicesConfig)6 Test (org.junit.Test)5 TenantName (com.yahoo.config.provision.TenantName)4 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 Applications (com.yahoo.cloud.config.LbServicesConfig.Tenants.Applications)1 RoutingConfig (com.yahoo.cloud.config.RoutingConfig)1 ConfigurationRuntimeException (com.yahoo.config.ConfigurationRuntimeException)1 ApplicationInfo (com.yahoo.config.model.api.ApplicationInfo)1 SuperModel (com.yahoo.config.model.api.SuperModel)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 RegionName (com.yahoo.config.provision.RegionName)1 Version (com.yahoo.config.provision.Version)1 Zone (com.yahoo.config.provision.Zone)1 ConfigKey (com.yahoo.vespa.config.ConfigKey)1 SuperModelConfigProvider (com.yahoo.vespa.config.server.model.SuperModelConfigProvider)1 UncompressedConfigResponseFactory (com.yahoo.vespa.config.server.rpc.UncompressedConfigResponseFactory)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 File (java.io.File)1