InstanceProviderManager { boolean verifyProviderEndpoint(String host) { if (providerEndpoints.isEmpty()) { return true; } for (String endpoint : providerEndpoints) { if (host.endsWith(endpoint)) { return true; } } return false; } InstanceProviderManager(DataStore dataStore, SSLContext sslContext, KeyStore keyStore);   }
@Test public void testVerifyProviderEndpoint() { InstanceProviderManager providerManager = new InstanceProviderManager(null, null, null); assertTrue(providerManager.verifyProviderEndpoint("test1.athenz.com")); assertTrue(providerManager.verifyProviderEndpoint("test1.athenz2.com")); assertFalse(providerManager.verifyProviderEndpoint("test1.athenz3.com")); providerManager.providerEndpoints = Collections.emptyList(); assertTrue(providerManager.verifyProviderEndpoint("test1.athenz.com")); assertTrue(providerManager.verifyProviderEndpoint("test1.athenz2.com")); assertTrue(providerManager.verifyProviderEndpoint("test1.athenz3.com")); }