HomeCommunityMap { public static String getCommunityIdForDeferredRDResponse(RetrieveDocumentSetResponseType body) { String responseCommunityID = null; if (body != null && NullChecker.isNotNullish(body.getDocumentResponse()) && body.getDocumentResponse().get(0) != null) { responseCommunityID = body.getDocumentResponse().get(0).getHomeCommunityId(); } return formatHomeCommunityId(responseCommunityID); }  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 testGetCommunityIdForDeferredRDResponse() { String communityId = HomeCommunityMap.getCommunityIdForDeferredRDResponse(null); assertEquals(null, communityId); RetrieveDocumentSetResponseType doc = new RetrieveDocumentSetResponseType(); communityId = HomeCommunityMap.getCommunityIdForDeferredRDResponse(doc); assertEquals(null, communityId); DocumentResponse docResponse = new DocumentResponse(); doc.getDocumentResponse().add(docResponse); communityId = HomeCommunityMap.getCommunityIdForDeferredRDResponse(doc); assertEquals(null, communityId); doc.getDocumentResponse().get(0).setHomeCommunityId("1.1"); communityId = HomeCommunityMap.getCommunityIdForDeferredRDResponse(doc); assertEquals("1.1", communityId); }