use of org.orcid.jaxb.model.message.OrcidSearchResult in project ORCID-Source by ORCID.
the class OrcidSearchManagerImplTest method orcidMultipleOrcidsIndexed.
/**
*/
@Test
public void orcidMultipleOrcidsIndexed() {
when(mockSolrDao.findByDocumentCriteria("rndQuery", null, null)).thenReturn(multipleResultsForQuery());
when(mockOrcidProfileCacheManager.retrievePublicBio("5678")).thenReturn(getOrcidProfile5678MandatoryOnly());
when(mockOrcidProfileCacheManager.retrievePublicBio("6789")).thenReturn(getOrcidProfile6789MandatoryOnly());
OrcidMessage retrievedOrcidMessage = orcidSearchManager.findOrcidsByQuery("rndQuery");
assertNotNull(retrievedOrcidMessage);
assertTrue(retrievedOrcidMessage.getOrcidSearchResults().getOrcidSearchResult().size() == 2);
OrcidSearchResult result = retrievedOrcidMessage.getOrcidSearchResults().getOrcidSearchResult().get(0);
OrcidProfile retrievedProfile = result.getOrcidProfile();
assertEquals("5678", retrievedProfile.getOrcidIdentifier().getPath());
OrcidBio orcidBio = retrievedProfile.getOrcidBio();
assertEquals("Logan", orcidBio.getPersonalDetails().getFamilyName().getContent());
assertEquals("Donald Edward", orcidBio.getPersonalDetails().getGivenNames().getContent());
assertNull(orcidBio.getContactDetails());
OrcidSearchResult result2 = retrievedOrcidMessage.getOrcidSearchResults().getOrcidSearchResult().get(1);
OrcidProfile retrievedProfile2 = result2.getOrcidProfile();
assertEquals("6789", retrievedProfile2.getOrcidIdentifier().getPath());
OrcidBio orcidBio2 = retrievedProfile2.getOrcidBio();
assertEquals("Thomson", orcidBio2.getPersonalDetails().getFamilyName().getContent());
assertEquals("Homer J", orcidBio2.getPersonalDetails().getGivenNames().getContent());
assertNotNull(orcidBio2.getContactDetails());
assertEquals("don@semantico.com", orcidBio2.getContactDetails().retrievePrimaryEmail().getValue());
}
Aggregations