Search in sources :

Example 6 with InstanceProviderManager

use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetHttpsProvider.

@Test
public void testGetHttpsProvider() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather");
    assertNotNull(client);
    client.close();
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 7 with InstanceProviderManager

use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetHttpsProviderInvalidName.

@Test
public void testGetHttpsProviderInvalidName() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech");
    assertNull(client);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 8 with InstanceProviderManager

use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetProviderClientNoEndpoint.

@Test
public void testGetProviderClientNoEndpoint() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, false);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather");
    assertNull(client);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 9 with InstanceProviderManager

use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetProviderClientInvalidEndpointParse.

@Test
public void testGetProviderClientInvalidEndpointParse() {
    SignedDomain signedDomain = createSignedDomain("coretech", "weather", true, true, "://test.athenz.com/");
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather");
    assertNull(client);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 10 with InstanceProviderManager

use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetClassInstance.

@Test
public void testGetClassInstance() {
    InstanceProviderManager providerManager = new InstanceProviderManager(null, null);
    InstanceProvider provider = providerManager.getClassProvider("unknown.class", "provider");
    assertNull(provider);
    provider = providerManager.getClassProvider("com.yahoo.athenz.instance.provider.impl.InstanceAWSProvider", "provider");
    assertNotNull(provider);
    // we should get this from the cache now
    provider = providerManager.getClassProvider("com.yahoo.athenz.instance.provider.impl.InstanceAWSProvider", "provider");
    assertNotNull(provider);
    // some invalid class name
    provider = providerManager.getClassProvider("com.yahoo.athenz.unknown.class", "provider");
    assertNull(provider);
    try {
        providerManager.getClassProvider("com.yahoo.athenz.zts.ZTSConsts", "provider");
        fail();
    } catch (Exception ex) {
    }
}
Also used : InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) URISyntaxException(java.net.URISyntaxException) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Aggregations

InstanceProviderManager (com.yahoo.athenz.zts.InstanceProviderManager)14 Test (org.testng.annotations.Test)14 InstanceProvider (com.yahoo.athenz.instance.provider.InstanceProvider)11 SignedDomain (com.yahoo.athenz.zms.SignedDomain)10 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)1