ExchangeManager extends AbstractExchangeManager<UDDI_SPEC_VERSION> { @Override public List<OrganizationType> getAllOrganizations() throws ExchangeManagerException { refreshExchangeCacheIfRequired(); List<OrganizationType> orgList = new ArrayList<>(); for (Entry<String, Map<String, OrganizationType>> exEntry : exCache.entrySet()) { Map<String, OrganizationType> orgMap = exCache.get(exEntry.getKey()); for (Entry<String, OrganizationType> hcidKey : orgMap.entrySet()) { OrganizationType org = orgMap.get(hcidKey.getKey()); orgList.add(syncWithOverrides(org, hcidKey.getKey())); } } return orgList; } protected  ExchangeManager(); static ExchangeManager getInstance(); @Override String getDefaultExchange(); @Override void refreshExchangeCacheIfRequired(); @Override OrganizationType getOrganization(String hcid); @Override OrganizationType getOrganization(String exchangeName, String hcid); @Override String getEndpointURL(String hcid, String sServiceName, UDDI_SPEC_VERSION api_spec, String exchangeName); @Override List<OrganizationType> getAllOrganizations(); @Override List<OrganizationType> getAllOrganizations(String exchangeName); boolean updateExchangeInfo(long refreshInterval, BigInteger maxBackups, String defaultExchange); boolean deleteExchange(String exchangeName); boolean saveExchange(ExchangeType exchangeUpdate, String originalExchangeName); List<ExchangeType> getAllExchanges(); List<OrganizationType> getAllOrganizationsBy(String exchangeName); List<EndpointType> getAllEndpointTypesBy(String exchangeName, String hcid); ExchangeInfoType getExchangeInfoView(); boolean isRefreshLocked(); boolean toggleIsDisabledFor(String forExchangeName);  }
@Test public void testGetAllOrganizationExchangeWithOverrides() { Exchange<UDDI_SPEC_VERSION> exMgr = createExternalExchangeManagerForOverride(); try { List<OrganizationType> orgList = exMgr.getAllOrganizations(); assertEquals("List of Organization returned should be 3", 3, orgList.size()); for (OrganizationType org : orgList) { if (HCID_3.equalsIgnoreCase(org.getHcid())) { verifyOverridesEndpoint(org.getEndpointList().getEndpoint()); } } } catch (ExchangeManagerException ex) { fail("Error running testOverrideExchange: " + ex.getMessage()); } }
@Test public void testGetAllOrganizationForAnExchangeWithOverrides() { Exchange<UDDI_SPEC_VERSION> exMgr = createExternalExchangeManagerForOverride(); try { List<OrganizationType> orgList = exMgr.getAllOrganizations(STATE_EXCHANGE); assertEquals("List of Organization returned for default Exchange should be 1", 1, orgList.size()); verifyOverridesEndpoint(orgList.get(0).getEndpointList().getEndpoint()); } catch (ExchangeManagerException ex) { fail("Error running testOverrideExchange: " + ex.getMessage()); } }