OpenStackRegionImpl implements OpenStackRegion { public String getChefServerEndPoint(String regionName) throws OpenStackException { String url; try { url = getEndPointByNameAndRegionName("chef-server", regionName); } catch (OpenStackException e) { String msn = "It is not possible to obtain the chef-server endpoint"; log.error(msn); throw new OpenStackException(msn); } log.debug("Obtained chef-server endpoint " + url); return url; } OpenStackRegionImpl(); @Override String getEndPointByNameAndRegionName(String type, String regionName); OpenStackAccess getTokenAdmin(); @Override String getNovaEndPoint(String regionName); @Override String getPuppetMasterEndPoint(String regionName); @Override String getQuantumEndPoint(String regionName); String getSdcEndPoint(String regionName); String getDefaultRegion(); String getSupportEndPoint(); SystemPropertiesProvider getSystemPropertiesProvider(); void setSystemPropertiesProvider(SystemPropertiesProvider systemPropertiesProvider); Client getClient(); void setClient(Client client); String getFederatedQuantumEndPoint(); String getChefServerEndPoint(String regionName); HttpClientConnectionManager getHttpConnectionManager(); void setHttpConnectionManager(HttpClientConnectionManager httpConnectionManager); RegionCache getRegionCache();  }
@Test public void testShouldGetEndPointsForChefAndARegionNameUsingCache() throws OpenStackException { OpenStackRegionImpl openStackRegion = new OpenStackRegionImpl(); String regionName = "RegionOne"; RegionCache regionCache = new RegionCache(); regionCache.putUrl("RegionOne", "chef-server", "https: String resultURL = openStackRegion.getChefServerEndPoint(regionName); assertNotNull(resultURL); assertEquals("https: }