HomeCommunityMap { public static String getHomeCommunityName(String sHomeCommunityId) { String sHomeCommunityName = ""; try { OrganizationType org = exManager.getOrganization(sHomeCommunityId); if (null != org) { sHomeCommunityName = org.getName(); } } catch (Exception e) { LOG.warn("Failed to retrieve textual name for home community ID: {}", e.getLocalizedMessage(), e); } return sHomeCommunityName; }  static String getSNIName(String exchangeName); static String getHomeCommunityName(String sHomeCommunityId); static String getCommunityIdFromTargetCommunities(NhinTargetCommunitiesType target); static String getCommunityIdFromTargetSystem(NhinTargetSystemType target); static String getCommunityIdFromAssertion(AssertionType assertion); static String getHomeCommunityIdFromAssertion(AssertionType assertion); static String getCommunityId(AdhocQueryType body); static String getCommunityIdForDeferredQDResponse(AdhocQueryResponse body); static String getCommunityIdForRDRequest(RetrieveDocumentSetRequestType body); static String getCommunityIdForDeferredRDResponse(RetrieveDocumentSetResponseType body); static String formatHomeCommunityId(String communityId); static String getLocalHomeCommunityId(); static String getHomeCommunityIdWithPrefix(String communityId); static String getHomeCommunityWithoutPrefix(String hcid); static String appendPrefixHomeCommunityID(final String homeCommunityId); static boolean equalsIgnoreCaseForHCID(final String communityId, final String hcidValue); static String checkPrefixBeforeAppend(final String checkValue, final String checkPrefix);  }
@Test public void testGetHomeCommunityName() { final String homeCommunityName = "DoD"; try { String homeCommunityId = "1.1"; HomeCommunityMap.setExchangeManager(exManager); when(exManager.getOrganization(Mockito.anyString())).thenReturn(createOrganization(homeCommunityName)); String foundName = HomeCommunityMap.getHomeCommunityName(homeCommunityId); assertEquals(homeCommunityName, foundName); } catch (Exception e) { e.printStackTrace(); fail("Error running testGetHomeCommunityName test: " + e.getMessage()); } }