Search in sources :

Example 81 with ExternalIDs

use of org.orcid.jaxb.model.v3.dev1.record.ExternalIDs in project ORCID-Source by ORCID.

the class ExternalIDValidatorTest method testEmptyRelationshipOnExternalIds_flagOn.

@Test(expected = ActivityIdentifierValidationException.class)
public void testEmptyRelationshipOnExternalIds_flagOn() {
    validator.setRequireRelationshipOnExternalIdentifier(true);
    ExternalIDs extIds = new ExternalIDs();
    ExternalID id1 = new ExternalID();
    id1.setRelationship(Relationship.SELF);
    id1.setType("doi");
    id1.setValue("value1");
    id1.setUrl(new Url("http://value1.com"));
    ExternalID id2 = new ExternalID();
    id2.setRelationship(null);
    id2.setType("doi");
    id2.setValue("value1");
    id2.setUrl(new Url("http://value1.com"));
    ExternalID id3 = new ExternalID();
    id3.setRelationship(Relationship.SELF);
    id3.setType("doi");
    id3.setValue("value1");
    id3.setUrl(new Url("http://value1.com"));
    extIds.getExternalIdentifier().add(id1);
    extIds.getExternalIdentifier().add(id2);
    extIds.getExternalIdentifier().add(id3);
    validator.validateWorkOrPeerReview(extIds);
    fail("no exception thrown for invalid type");
}
Also used : ExternalIDs(org.orcid.jaxb.model.v3.dev1.record.ExternalIDs) ExternalID(org.orcid.jaxb.model.v3.dev1.record.ExternalID) Url(org.orcid.jaxb.model.v3.dev1.common.Url) Test(org.junit.Test)

Aggregations

ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)75 ExternalIDs (org.orcid.jaxb.model.v3.dev1.record.ExternalIDs)72 Url (org.orcid.jaxb.model.v3.dev1.common.Url)49 Test (org.junit.Test)45 Title (org.orcid.jaxb.model.v3.dev1.common.Title)23 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)22 Response (javax.ws.rs.core.Response)20 DBUnitTest (org.orcid.test.DBUnitTest)20 WorkTitle (org.orcid.jaxb.model.v3.dev1.record.WorkTitle)19 List (java.util.List)15 Work (org.orcid.jaxb.model.v3.dev1.record.Work)14 TransientNonEmptyString (org.orcid.jaxb.model.v3.dev1.common.TransientNonEmptyString)8 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)8 WorkBulk (org.orcid.jaxb.model.v3.dev1.record.WorkBulk)7 BaseTest (org.orcid.core.BaseTest)6 JSONUrl (org.orcid.core.adapter.jsonidentifier.JSONUrl)6 DisambiguatedOrganization (org.orcid.jaxb.model.v3.dev1.common.DisambiguatedOrganization)6 Organization (org.orcid.jaxb.model.v3.dev1.common.Organization)6 OrganizationAddress (org.orcid.jaxb.model.v3.dev1.common.OrganizationAddress)6 FundingTitle (org.orcid.jaxb.model.v3.dev1.record.FundingTitle)6