use of org.orcid.listener.solr.OrcidProfileToSolrDocument in project ORCID-Source by ORCID.
the class OrcidRecordToSolrDocumentTest method test12SameAs20.
@Test
public void test12SameAs20() throws IOException, SolrServerException, JAXBException {
OrcidProfileToSolrDocument v12 = new OrcidProfileToSolrDocument();
OrcidRecordToSolrDocument v20 = new OrcidRecordToSolrDocument(false);
Record record = getRecord("/v20record.xml");
OrcidMessage message = getOrcidMessage();
OrcidSolrDocument v12Doc = v12.convert(message.getOrcidProfile());
OrcidSolrDocument v20Doc = v20.convert(record, new ArrayList<Funding>());
Assert.assertEquals(v12Doc.getOrcid(), v20Doc.getOrcid());
Assert.assertEquals(v12Doc.getFamilyName(), v20Doc.getFamilyName());
Assert.assertEquals(v12Doc.getGivenNames(), v20Doc.getGivenNames());
Assert.assertEquals(v12Doc.getGivenAndFamilyNames(), v20Doc.getGivenAndFamilyNames());
Assert.assertTrue(v12Doc.getDigitalObjectIds().containsAll(v20Doc.getDigitalObjectIds()));
Assert.assertTrue(v20Doc.getDigitalObjectIds().containsAll(v12Doc.getDigitalObjectIds()));
Assert.assertTrue(v12Doc.getWorkTitles().containsAll(v20Doc.getWorkTitles()));
Assert.assertTrue(v20Doc.getWorkTitles().containsAll(v12Doc.getWorkTitles()));
Assert.assertTrue(v12Doc.getCit().containsAll(v20Doc.getCit()));
Assert.assertTrue(v20Doc.getCit().containsAll(v12Doc.getCit()));
Assert.assertTrue(v12Doc.getAgr().containsAll(v20Doc.getAgr()));
Assert.assertTrue(v20Doc.getAgr().containsAll(v12Doc.getAgr()));
Assert.assertEquals(v12Doc.getProfileLastModifiedDate(), v20Doc.getProfileLastModifiedDate());
Assert.assertEquals(v12Doc.getProfileSubmissionDate(), v20Doc.getProfileSubmissionDate());
}
Aggregations