Exemplo n.º 1
0
 @Test
 public void validateExternalIdentifier_invalidRelationship2_flagOffTest() {
   PersonExternalIdentifier extId = getPersonExternalIdentifier();
   extId.setRelationship(Relationship.PART_OF);
   PersonValidator.validateExternalIdentifier(
       extId, getSourceEntity(), true, true, Visibility.PUBLIC, false);
 }
Exemplo n.º 2
0
 @Test(expected = OrcidValidationException.class)
 public void validateExternalIdentifier_invalidUrl_emptyUrlTest() {
   PersonExternalIdentifier extId = getPersonExternalIdentifier();
   extId.setUrl(new Url());
   PersonValidator.validateExternalIdentifier(
       extId, getSourceEntity(), true, true, Visibility.PUBLIC, true);
   fail();
 }
Exemplo n.º 3
0
 @Test(expected = OrcidValidationException.class)
 public void validateExternalIdentifier_invalidRelationship2_flagOnTest() {
   PersonExternalIdentifier extId = getPersonExternalIdentifier();
   extId.setRelationship(Relationship.PART_OF);
   PersonValidator.validateExternalIdentifier(
       extId, getSourceEntity(), true, true, Visibility.PUBLIC, true);
   fail();
 }
Exemplo n.º 4
0
 @Test(expected = PutCodeRequiredException.class)
 public void validateExternalIdentifier_invalidPutCodeOnUpdateTest() {
   PersonExternalIdentifier extId = getPersonExternalIdentifier();
   extId.setPutCode(null);
   PersonValidator.validateExternalIdentifier(
       extId, getSourceEntity(), false, true, Visibility.PUBLIC, true);
   fail();
 }
Exemplo n.º 5
0
 @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();
 }
Exemplo n.º 6
0
 private PersonExternalIdentifier getPersonExternalIdentifier() {
   PersonExternalIdentifier extId = new PersonExternalIdentifier();
   extId.setRelationship(Relationship.SELF);
   extId.setType("doi");
   extId.setUrl(new Url("http://test.orcid.org"));
   extId.setValue("extId1");
   extId.setVisibility(Visibility.PUBLIC);
   return extId;
 }