Search in sources :

Example 1 with IdentityConfig

use of com.yahoo.container.core.identity.IdentityConfig in project vespa by vespa-engine.

the class IdentityBuilderTest method identity_config_produced_from_deployment_spec.

@Test
public void identity_config_produced_from_deployment_spec() throws IOException, SAXException {
    Element clusterElem = DomBuilderTest.parse("<jdisc id='default' version='1.0'><search /></jdisc>");
    String deploymentXml = "<deployment version='1.0' athenz-domain='domain' athenz-service='service'>\n" + "    <test/>\n" + "    <prod>\n" + "        <region active='true'>default</region>\n" + "    </prod>\n" + "</deployment>\n";
    ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withDeploymentSpec(deploymentXml).build();
    createModel(root, DeployState.createTestState(applicationPackage), clusterElem);
    IdentityConfig identityConfig = root.getConfig(IdentityConfig.class, "default/component/" + IdentityProvider.CLASS);
    assertEquals("domain", identityConfig.domain());
    assertEquals("service", identityConfig.service());
}
Also used : Element(org.w3c.dom.Element) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) IdentityConfig(com.yahoo.container.core.identity.IdentityConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 IdentityConfig (com.yahoo.container.core.identity.IdentityConfig)1 Test (org.junit.Test)1 Element (org.w3c.dom.Element)1