use of org.orcid.jaxb.model.v3.dev1.record.Relationship in project ORCID-Source by ORCID.
the class JSONExternalIdentifiersConverterV3Test method testConvertTo.
@Test
public void testConvertTo() throws JAXBException {
Education education = getEducation();
assertEquals("{\"externalIdentifier\":[{\"type\":\"GRANT_NUMBER\",\"value\":\"external-identifier-value\",\"url\":{\"value\":\"http://tempuri.org\"},\"relationship\":\"SELF\"},{\"type\":\"GRANT_NUMBER\",\"value\":\"external-identifier-value2\",\"url\":{\"value\":\"http://tempuri.org/2\"},\"relationship\":\"SELF\"}]}", converter.convertTo(education.getExternalIdentifiers(), null));
}
use of org.orcid.jaxb.model.v3.dev1.record.Relationship in project ORCID-Source by ORCID.
the class JSONPeerReviewWorkExternalIdentifierConverterV3Test method testConvertTo.
@Test
public void testConvertTo() throws JAXBException {
PeerReview peerReview = getPeerReview();
assertEquals("{\"relationship\":\"SELF\",\"url\":{\"value\":\"http://orcid.org\"},\"workExternalIdentifierType\":\"DOI\",\"workExternalIdentifierId\":{\"content\":\"peer-review:subject-external-identifier-id\"}}", converter.convertTo(peerReview.getSubjectExternalIdentifier(), null));
}
use of org.orcid.jaxb.model.v3.dev1.record.Relationship in project ORCID-Source by ORCID.
the class JSONWorkExternalIdentifiersConverterV3Test method testConvertTo.
@Test
public void testConvertTo() throws JAXBException {
Work work = getWork();
assertEquals("{\"workExternalIdentifier\":[{\"relationship\":\"SELF\",\"url\":{\"value\":\"http://orcid.org\"},\"workExternalIdentifierType\":\"AGR\",\"workExternalIdentifierId\":{\"content\":\"work:external-identifier-id\"}}]}", converter.convertTo(work.getExternalIdentifiers(), null));
}
use of org.orcid.jaxb.model.v3.dev1.record.Relationship in project ORCID-Source by ORCID.
the class ExternalIDValidatorTest method testEmptyRelationshipOnSingleExternalId_flagOff.
@Test
public void testEmptyRelationshipOnSingleExternalId_flagOff() {
ExternalID id1 = new ExternalID();
id1.setType("doi");
id1.setValue("value1");
id1.setUrl(new Url("http://value1.com"));
validator.validateWorkOrPeerReview(id1);
// empty relationship
id1.setRelationship(null);
validator.validateWorkOrPeerReview(id1);
}
use of org.orcid.jaxb.model.v3.dev1.record.Relationship in project ORCID-Source by ORCID.
the class JpaJaxbPeerReviewAdapterTest method testToOrgAffiliationRelationEntity.
@Test
public void testToOrgAffiliationRelationEntity() throws JAXBException {
PeerReview e = getPeerReview(true);
assertNotNull(e);
PeerReviewEntity pe = jpaJaxbPeerReviewAdapter.toPeerReviewEntity(e);
assertNotNull(pe);
// General info
assertEquals(Long.valueOf(12345), pe.getId());
assertEquals(Visibility.PRIVATE.value(), pe.getVisibility().value());
assertEquals("{\"workExternalIdentifier\":[{\"relationship\":\"SELF\",\"url\":{\"value\":\"http://orcid.org\"},\"workExternalIdentifierType\":\"SOURCE_WORK_ID\",\"workExternalIdentifierId\":{\"content\":\"work:external-identifier-id\"}}]}", pe.getExternalIdentifiersJson());
assertEquals("reviewer", pe.getRole().value());
assertEquals("review", pe.getType().value());
assertEquals("peer-review:url", pe.getUrl());
// Dates
assertEquals(Integer.valueOf(2), pe.getCompletionDate().getDay());
assertEquals(Integer.valueOf(2), pe.getCompletionDate().getMonth());
assertEquals(Integer.valueOf(1848), pe.getCompletionDate().getYear());
// Source
assertNull(pe.getSourceId());
assertNull(pe.getClientSourceId());
assertNull(pe.getElementSourceId());
// Check org values
assertEquals("common:name", pe.getOrg().getName());
assertEquals("common:city", pe.getOrg().getCity());
assertEquals("common:region", pe.getOrg().getRegion());
assertEquals(org.orcid.jaxb.model.common_v2.Iso3166Country.AF.value(), pe.getOrg().getCountry().value());
assertEquals("http://dx.doi.org/10.13039/100000001", pe.getOrg().getOrgDisambiguated().getSourceId());
assertEquals("FUNDREF", pe.getOrg().getOrgDisambiguated().getSourceType());
// Check subject
assertEquals("{\"relationship\":\"SELF\",\"url\":{\"value\":\"http://orcid.org\"},\"workExternalIdentifierType\":\"DOI\",\"workExternalIdentifierId\":{\"content\":\"peer-review:subject-external-identifier-id\"}}", pe.getSubjectExternalIdentifiersJson());
assertEquals("peer-review:subject-container-name", pe.getSubjectContainerName());
assertEquals("peer-review:subject-name", pe.getSubjectName());
assertEquals("peer-review:subject-translated-name", pe.getSubjectTranslatedName());
assertEquals("en", pe.getSubjectTranslatedNameLanguageCode());
assertEquals("peer-review:subject-url", pe.getSubjectUrl());
assertEquals(org.orcid.jaxb.model.record_v2.WorkType.JOURNAL_ARTICLE, pe.getSubjectType());
// Check group id
assertEquals("orcid-generated:12345", pe.getGroupId());
}
Aggregations