diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ReadRecordTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ReadRecordTest.java index db65c7b9882..21629f64516 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ReadRecordTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV2/server/delegator/MemberV2ApiServiceDelegator_ReadRecordTest.java @@ -228,24 +228,28 @@ public void testViewRecord() { Utils.verifyLastModified(email.getLastModifiedDate()); if (email.getEmail().equals("public_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.PUBLIC.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.value(), email.getVisibility().value()); assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("limited_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.LIMITED.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.LIMITED.value(), email.getVisibility().value()); assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("private_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.PRIVATE.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE.value(), email.getVisibility().value()); assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("self_limited_0000-0000-0000-0003@test.orcid.org")) { assertEquals("0000-0000-0000-0003", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.LIMITED.value(), email.getVisibility().value()); + assertNotNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.LIMITED.value(), email.getVisibility().value()); assertEquals("Credit Name", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("public_0000-0000-0000-0003@orcid.org")) { assertEquals("0000-0000-0000-0000", email.getSource().retrieveSourcePath()); assertNull(email.getSource().getSourceOrcid()); - assertEquals(Visibility.PUBLIC.value(), email.getVisibility().value()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.value(), email.getVisibility().value()); assertEquals("ORCID email validation", email.getSource().getSourceName().getContent()); } else { fail("Invalid email found: " + email.getEmail()); diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ReadRecordTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ReadRecordTest.java index 65c5508cc1e..bb8ecf57165 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ReadRecordTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator_ReadRecordTest.java @@ -235,21 +235,34 @@ public void testViewRecord() { assertNotNull(person.getEmails()); Utils.verifyLastModified(person.getEmails().getLastModifiedDate()); assertEquals("/0000-0000-0000-0003/email", person.getEmails().getPath()); - assertEquals(4, person.getEmails().getEmails().size()); + assertEquals(5, person.getEmails().getEmails().size()); for (Email email : person.getEmails().getEmails()) { Utils.verifyLastModified(email.getLastModifiedDate()); if (email.getEmail().equals("public_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.PUBLIC.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.value(), email.getVisibility().value()); + assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("limited_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.LIMITED.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.LIMITED.value(), email.getVisibility().value()); + assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("private_0000-0000-0000-0003@test.orcid.org")) { assertEquals("APP-5555555555555555", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.PRIVATE.value(), email.getVisibility().value()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE.value(), email.getVisibility().value()); + assertEquals("Source Client 1", email.getSource().getSourceName().getContent()); } else if (email.getEmail().equals("self_limited_0000-0000-0000-0003@test.orcid.org")) { assertEquals("0000-0000-0000-0003", email.getSource().retrieveSourcePath()); - assertEquals(Visibility.LIMITED.value(), email.getVisibility().value()); + assertNotNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.LIMITED.value(), email.getVisibility().value()); + assertEquals("Credit Name", email.getSource().getSourceName().getContent()); + } else if (email.getEmail().equals("public_0000-0000-0000-0003@orcid.org")) { + assertEquals("0000-0000-0000-0000", email.getSource().retrieveSourcePath()); + assertNull(email.getSource().getSourceOrcid()); + assertEquals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.value(), email.getVisibility().value()); + assertEquals("ORCID email validation", email.getSource().getSourceName().getContent()); } else { fail("Invalid email found: " + email.getEmail()); }