Search in sources :

Example 1 with InstanceProviderManager

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

the class InstanceProviderManagerTest method testGetHttpsProviderUnknownProvider.

@Test
public void testGetHttpsProviderUnknownProvider() {
    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 2 with InstanceProviderManager

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

the class InstanceProviderManagerTest method testGetProviderScheme.

@Test
public void testGetProviderScheme() throws URISyntaxException {
    InstanceProviderManager provider = new InstanceProviderManager(null, null);
    URI uri = new URI("https://test.athenz2.com/");
    assertEquals(provider.getProviderScheme(uri), ProviderScheme.HTTPS);
    uri = new URI("class://com.yahoo.athenz.AWSProvider");
    assertEquals(provider.getProviderScheme(uri), ProviderScheme.CLASS);
    uri = new URI("http://test.athenz2.com/");
    assertEquals(provider.getProviderScheme(uri), ProviderScheme.UNKNOWN);
    uri = new URI("ftp://test.athenz2.com/");
    assertEquals(provider.getProviderScheme(uri), ProviderScheme.UNKNOWN);
    uri = new URI("test.athenz2.com/");
    assertEquals(provider.getProviderScheme(uri), ProviderScheme.UNKNOWN);
}
Also used : InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) URI(java.net.URI) Test(org.testng.annotations.Test)

Example 3 with InstanceProviderManager

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

the class InstanceProviderManagerTest method testGetProviderClientInvalidService.

@Test
public void testGetProviderClientInvalidService() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather2");
    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 4 with InstanceProviderManager

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

the class InstanceProviderManagerTest method testGetClassProvider.

@Test
public void testGetClassProvider() {
    SignedDomain signedDomain = createSignedDomainClassEndpoint("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 5 with InstanceProviderManager

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

the class InstanceProviderManagerTest method testGetProviderClientInvalidDomain.

@Test
public void testGetProviderClientInvalidDomain() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech2.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)

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