Search in sources :

Example 26 with ExternalID

use of org.orcid.jaxb.model.record_rc4.ExternalID in project ORCID-Source by ORCID.

the class JpaJaxbWorkAdapterTest method fromProfileWorkEntityToWorkSummaryTest.

@Test
public void fromProfileWorkEntityToWorkSummaryTest() {
    WorkEntity work = getWorkEntity();
    assertNotNull(work);
    WorkSummary ws = jpaJaxbWorkAdapter.toWorkSummary(work);
    assertNotNull(ws);
    assertEquals(Long.valueOf(12345), ws.getPutCode());
    assertEquals(Visibility.LIMITED.value(), ws.getVisibility().value());
    assertEquals("1234567890", ws.getDisplayIndex());
    assertNotNull(ws.getExternalIdentifiers());
    assertNotNull(ws.getExternalIdentifiers().getExternalIdentifier());
    assertEquals(1, ws.getExternalIdentifiers().getExternalIdentifier().size());
    ExternalID workExtId = ws.getExternalIdentifiers().getExternalIdentifier().get(0);
    assertNotNull(workExtId.getValue());
    assertEquals("123", workExtId.getValue());
    assertNotNull(workExtId.getType());
    assertEquals(org.orcid.jaxb.model.message.WorkExternalIdentifierType.AGR.value(), workExtId.getType());
}
Also used : WorkEntity(org.orcid.persistence.jpa.entities.WorkEntity) WorkSummary(org.orcid.jaxb.model.record.summary_v2.WorkSummary) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) Test(org.junit.Test)

Example 27 with ExternalID

use of org.orcid.jaxb.model.record_rc4.ExternalID in project ORCID-Source by ORCID.

the class EmailMessageSenderTest method createActivity.

private Item createActivity(ItemType actType, String actName, String doi) {
    Item act = new Item();
    act.setItemType(actType);
    act.setItemName(actName);
    ExternalID extId = new ExternalID();
    extId.setType("doi");
    extId.setValue(doi);
    act.setExternalIdentifier(extId);
    return act;
}
Also used : Item(org.orcid.jaxb.model.notification.permission_v2.Item) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID)

Example 28 with ExternalID

use of org.orcid.jaxb.model.record_rc4.ExternalID in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createPeerReviewSummary.

protected PeerReviewSummary createPeerReviewSummary(Visibility v, String sourceId, String extIdValue) {
    PeerReviewSummary p = new PeerReviewSummary();
    p.setVisibility(v);
    p.setGroupId(EXTID_SHARED);
    setSource(p, sourceId);
    ExternalID extId = new ExternalID();
    extId.setValue(extIdValue);
    ExternalIDs extIds = new ExternalIDs();
    extIds.getExternalIdentifier().add(extId);
    addSharedExtId(extIds);
    p.setExternalIdentifiers(extIds);
    return p;
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) PeerReviewSummary(org.orcid.jaxb.model.record.summary_v2.PeerReviewSummary) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID)

Example 29 with ExternalID

use of org.orcid.jaxb.model.record_rc4.ExternalID in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createFundingSummary.

protected FundingSummary createFundingSummary(Visibility v, String sourceId, String extIdValue) {
    FundingSummary f = new FundingSummary();
    f.setVisibility(v);
    setSource(f, sourceId);
    ExternalID extId = new ExternalID();
    extId.setValue(extIdValue);
    ExternalIDs extIds = new ExternalIDs();
    extIds.getExternalIdentifier().add(extId);
    addSharedExtId(extIds);
    f.setExternalIdentifiers(extIds);
    return f;
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) FundingSummary(org.orcid.jaxb.model.record.summary_v2.FundingSummary)

Example 30 with ExternalID

use of org.orcid.jaxb.model.record_rc4.ExternalID in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method getExtId.

protected ExternalID getExtId(String value) {
    ExternalID extId = new ExternalID();
    extId.setValue(value);
    return extId;
}
Also used : ExternalID(org.orcid.jaxb.model.record_v2.ExternalID)

Aggregations

ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)110 Test (org.junit.Test)97 Url (org.orcid.jaxb.model.common_v2.Url)55 ClientResponse (com.sun.jersey.api.client.ClientResponse)52 ExternalIDs (org.orcid.jaxb.model.record_v2.ExternalIDs)50 Work (org.orcid.jaxb.model.record_v2.Work)32 Title (org.orcid.jaxb.model.common_v2.Title)28 WorkTitle (org.orcid.jaxb.model.record_v2.WorkTitle)22 Funding (org.orcid.jaxb.model.record_v2.Funding)16 PeerReview (org.orcid.jaxb.model.record_v2.PeerReview)16 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)14 ArrayList (java.util.ArrayList)13 ExternalID (org.orcid.jaxb.model.record_rc3.ExternalID)13 ExternalID (org.orcid.jaxb.model.record_rc4.ExternalID)13 FundingTitle (org.orcid.jaxb.model.record_v2.FundingTitle)11 OrcidError (org.orcid.jaxb.model.error_v2.OrcidError)9 WorkGroup (org.orcid.jaxb.model.record.summary_v2.WorkGroup)8 ExternalID (org.orcid.jaxb.model.record_rc2.ExternalID)8 List (java.util.List)7 Validator (javax.xml.validation.Validator)7