use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.
the class InstanceProviderManagerTest method testVerifyProviderEndpoint.
@Test
public void testVerifyProviderEndpoint() {
InstanceProviderManager providerManager = new InstanceProviderManager(null, null);
assertTrue(providerManager.verifyProviderEndpoint("test1.athenz.com"));
assertTrue(providerManager.verifyProviderEndpoint("test1.athenz2.com"));
assertFalse(providerManager.verifyProviderEndpoint("test1.athenz3.com"));
// now let's remove our config in which case all is true
providerManager.providerEndpoints = Collections.emptyList();
assertTrue(providerManager.verifyProviderEndpoint("test1.athenz.com"));
assertTrue(providerManager.verifyProviderEndpoint("test1.athenz2.com"));
assertTrue(providerManager.verifyProviderEndpoint("test1.athenz3.com"));
}
use of com.yahoo.athenz.zts.InstanceProviderManager in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetProviderClientInvalidEndpoint.
@Test
public void testGetProviderClientInvalidEndpoint() {
SignedDomain signedDomain = createSignedDomain("coretech", "weather", true, true, "http://invalid");
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 testGetProviderClientNoServices.
@Test
public void testGetProviderClientNoServices() {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", false, true);
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 testGetProviderEndpointScheme.
@Test
public void testGetProviderEndpointScheme() throws URISyntaxException {
InstanceProviderManager provider = new InstanceProviderManager(null, null);
URI uri = new URI("https://test.athenz2.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.HTTPS);
uri = new URI("https://test.athenz2.com:4443/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.HTTPS);
uri = new URI("https://test.athenz2.com:4443/test1");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.HTTPS);
uri = new URI("class://com.yahoo.athenz.AWSProvider");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.CLASS);
uri = new URI("http://test.athenz.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("https://test.athenz4.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://test.athenz.com:4443/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://test.athenz.com:4443/test1");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://:4443?key=value");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://test.athenz3.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://test.athenz3.com:4443/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("http://test.athenz3.com:4443/test1");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("test.athenz.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("file://test.athenz.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("//test.athenz.com/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("test://test.athenz.com:4443/");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
uri = new URI("uri://test.athenz.com:4443/test1");
assertEquals(provider.getProviderEndpointScheme(uri), ProviderScheme.UNKNOWN);
}
Aggregations