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");
}
Aggregations