ConnectionManagerCache implements ConnectionManager { @Override public String getAdapterEndpointURL(String sHomeCommunityId, String sServiceName, ADAPTER_API_LEVEL level) throws ConnectionManagerException { ConnectionManagerCacheHelper helper = new ConnectionManagerCacheHelper(); String endpointUrl = null; BusinessEntity oEntity = getBusinessEntityByServiceName(sHomeCommunityId, sServiceName); BindingTemplate template = helper.findBindingTemplateByCategoryBagNameValue(oEntity, sServiceName, INTERNAL_CONNECTION_API_LEVEL_KEY, level.toString()); if (template != null) { endpointUrl = template.getAccessPoint().getValue(); } return endpointUrl; } ConnectionManagerCache();  ConnectionManagerCache(PropertyAccessor accessor); static ConnectionManagerCache getInstance(); void setCommunityId(BusinessEntity businessEntity, String newId); void forceRefreshUDDICache(); void forceRefreshInternalConnectCache(); @Override List<BusinessEntity> getAllBusinessEntities(); @Override BusinessEntity getBusinessEntity(String sHomeCommunityId); @Override String getBusinessEntityName(String homeCommunityId); @Override Set<BusinessEntity> getBusinessEntitySet(List<String> saHomeCommunityId); @Override BusinessEntity getBusinessEntityByServiceName(String sHomeCommunityId, String sUniformServiceName); @Override BusinessEntity getBusinessEntityByHCID(String sHomeCommunityId); @Override Set<BusinessEntity> getBusinessEntitySetByServiceName(List<String> saHomeCommunityId,
        String sUniformServiceName); @Override Set<BusinessEntity> getAllBusinessEntitySetByServiceName(String sUniformServiceName); @Override List<UDDI_SPEC_VERSION> getSpecVersions(String homeCommunityId,
        NhincConstants.NHIN_SERVICE_NAMES serviceName); @Override String getAdapterEndpointURL(String sHomeCommunityId, String sServiceName, ADAPTER_API_LEVEL level); @Override String getAdapterEndpointURL(String sServiceName, ADAPTER_API_LEVEL level); @Override String getDefaultEndpointURLByServiceName(String sHomeCommunityId, String sUniformServiceName); @Override String getEndpointURLByServiceNameSpecVersion(String sHomeCommunityId, String sUniformServiceName,
        UDDI_SPEC_VERSION version); @Override String getInternalEndpointURLByServiceName(String sUniformServiceName); @Override String getEndpointURLFromNhinTarget(NhinTargetSystemType targetSystem, String serviceName); @Override List<UrlInfo> getEndpointURLFromNhinTargetCommunities(NhinTargetCommunitiesType targets, String serviceName); boolean updateInternalServiceUrl(String serviceName, String url);  }
@Test public void testGetAdapterEndpointURL() throws ConnectionManagerException, PropertyAccessException { ConnectionManagerCache connectionManager = createConnectionManager(); String localHomeCommunityId = "1.1"; when(accessor.getProperty(Mockito.anyString(), Mockito.anyString())).thenReturn(localHomeCommunityId); String url = connectionManager.getAdapterEndpointURL(QUERY_FOR_DOCUMENTS_NAME, ADAPTER_API_LEVEL.LEVEL_a0); assertNull(url); url = connectionManager.getAdapterEndpointURL(DOC_QUERY_DEFERRED_NAME, ADAPTER_API_LEVEL.LEVEL_a0); assertNotNull(url); assertTrue(url.equals(QUERY_FOR_DOCUMENTS_DEFERRED_URL)); }