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();
}
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);
}
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);
}
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);
}
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) {
}
}
Aggregations