use of org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier in project ORCID-Source by ORCID.
the class PersonValidatorTest method validateExternalIdentifier_invalidPutCodeOnUpdateTest.
@Test(expected = PutCodeRequiredException.class)
public void validateExternalIdentifier_invalidPutCodeOnUpdateTest() {
PersonExternalIdentifier extId = getPersonExternalIdentifier();
extId.setPutCode(null);
PersonValidator.validateExternalIdentifier(extId, getSourceEntity(), false, true, Visibility.PUBLIC, true);
fail();
}
use of org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier in project ORCID-Source by ORCID.
the class PersonValidatorTest method validateExternalIdentifier_invalidRelationship2_flagOffTest.
@Test
public void validateExternalIdentifier_invalidRelationship2_flagOffTest() {
PersonExternalIdentifier extId = getPersonExternalIdentifier();
extId.setRelationship(Relationship.PART_OF);
PersonValidator.validateExternalIdentifier(extId, getSourceEntity(), true, true, Visibility.PUBLIC, false);
}
use of org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier in project ORCID-Source by ORCID.
the class PersonValidatorTest method validateExternalIdentifier_visibilityDoesntChangeTest.
@Test(expected = VisibilityMismatchException.class)
public void validateExternalIdentifier_visibilityDoesntChangeTest() {
PersonExternalIdentifier extId = getPersonExternalIdentifier();
extId.setPutCode(1L);
extId.setVisibility(Visibility.LIMITED);
PersonValidator.validateExternalIdentifier(extId, getSourceEntity(), false, true, Visibility.PUBLIC, true);
fail();
}
use of org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier in project ORCID-Source by ORCID.
the class PersonValidatorTest method validateExternalIdentifier_invalidUrl_nullUrlTest.
@Test(expected = OrcidValidationException.class)
public void validateExternalIdentifier_invalidUrl_nullUrlTest() {
PersonExternalIdentifier extId = getPersonExternalIdentifier();
extId.setUrl(null);
PersonValidator.validateExternalIdentifier(extId, getSourceEntity(), true, true, Visibility.PUBLIC, true);
fail();
}
use of org.orcid.jaxb.model.v3.dev1.record.PersonExternalIdentifier in project ORCID-Source by ORCID.
the class JpaJaxbExternalIdentifierAdapterTest method fromExternalIdentifierEntityToExternalIdentifier.
@Test
public void fromExternalIdentifierEntityToExternalIdentifier() {
ExternalIdentifierEntity entity = getExternalIdentifierEntity();
PersonExternalIdentifier extId = jpaJaxbExternalIdentifierAdapter.toExternalIdentifier(entity);
assertNotNull(extId);
assertNotNull(extId.getCreatedDate());
assertNotNull(extId.getCreatedDate().getValue());
assertNotNull(extId.getLastModifiedDate());
assertNotNull(extId.getLastModifiedDate().getValue());
assertEquals("common-name", extId.getType());
assertEquals("id-reference", extId.getValue());
assertNotNull(extId.getUrl());
assertEquals("http://myurl.com", extId.getUrl().getValue());
assertEquals(Long.valueOf(123), extId.getPutCode());
assertNotNull(extId.getSource());
assertEquals("APP-0000000000000000", extId.getSource().retrieveSourcePath());
assertEquals(Visibility.LIMITED.value(), extId.getVisibility().value());
assertNotNull(extId.getCreatedDate());
assertNotNull(extId.getLastModifiedDate());
}
Aggregations