ConnectionHelper { public HashMap<String, OrganizationType> getExternalOrganizationsMap() { HashMap<String, OrganizationType> organizationMap = getRemoteHcidFromUUID(); if (organizationMap != null && !organizationMap.isEmpty()) { Iterator<Map.Entry<String, OrganizationType>> it = organizationMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, OrganizationType> entry = it.next(); if (checkLocalHcid(entry.getValue().getHcid())) { it.remove(); } } } return organizationMap; }  HashMap<String, OrganizationType> getRemoteHcidFromUUID(); HashMap<String, OrganizationType> getExternalOrganizationsMap(); OrganizationType getLocalOrganization(); Map<String, String> getOrgNameRemoteHcidExternalEntities(); Map<String, String> getRemoteHcidOrgNameMap(); Map<String, String> getOrgNameAndRemoteHcidMap(); OrganizationType getLocalOrganizationFromDefaultExchange(); Map<String, OrganizationType> getOrganizationsFromDefaultExchange();  }
@Test public void testGetExternalEntitiesMap() { List<String> actual = new ArrayList<>(); ConnectionHelper instance = new ConnectionHelper(); HashMap<String, OrganizationType> result = instance.getExternalOrganizationsMap(); for (Map.Entry<String, OrganizationType> entry : result.entrySet()) { actual.add(entry.getKey()); } assertTrue("Error communityname not available", actual.contains("urn:oid:2.2")); }
@Test public void testGetExternalEntitiesMapFromEmptyFile() { ConnectionHelper instance = new ConnectionHelper() { @Override protected List<OrganizationType> getAllOrganizations() { return null; } }; Map<String, BusinessEntity> expResult = new HashMap<>(); HashMap<String, OrganizationType> result = instance.getExternalOrganizationsMap(); assertEquals("Error empty UDDI file should not have entries", expResult, result); }