diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java index 3fcd322e53d..c815b9e24bf 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java @@ -43,11 +43,7 @@ import org.orcid.core.utils.JsonUtils; import org.orcid.core.utils.cache.redis.RedisClient; import org.orcid.core.utils.v3.SourceUtils; -import org.orcid.jaxb.model.v3.release.common.CreatedDate; -import org.orcid.jaxb.model.v3.release.common.FuzzyDate; -import org.orcid.jaxb.model.v3.release.common.LastModifiedDate; -import org.orcid.jaxb.model.v3.release.common.Source; -import org.orcid.jaxb.model.v3.release.common.Visibility; +import org.orcid.jaxb.model.v3.release.common.*; import org.orcid.jaxb.model.v3.release.record.AffiliationType; import org.orcid.jaxb.model.v3.release.record.Group; import org.orcid.jaxb.model.v3.release.record.GroupableActivity; @@ -286,6 +282,7 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) { for (EmailDomain ed : recordSummary.getEmailDomains().getEmailDomains()) { EmailDomainSummary eds = new EmailDomainSummary(); eds.setValue(ed.getValue()); + eds.setVerificationDate(ed.getVerificationDate().toString()); emailDomains.add(eds); } } @@ -524,6 +521,7 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); ed.setValue(ped.getEmailDomain()); + ed.setVerificationDate( new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated()))); edList.add(ed); } } @@ -531,6 +529,7 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci edList.stream().limit(3).forEach(t -> { EmailDomain ed = new EmailDomain(); ed.setValue(t.getValue()); + ed.setVerificationDate(t.getVerificationDate()); emailDomainsTop3.add(ed); }); @@ -538,7 +537,6 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci eds.setCount(edList.size()); if (!emailDomainsTop3.isEmpty()) { eds.setEmailDomains(emailDomainsTop3); - } recordSummary.setEmailDomains(eds); diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/ProfileEmailDomainManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/ProfileEmailDomainManagerImpl.java index ecbf129bd04..e4adee923e8 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/ProfileEmailDomainManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/ProfileEmailDomainManagerImpl.java @@ -42,6 +42,9 @@ public class ProfileEmailDomainManagerImpl extends ProfileEmailDomainManagerRead @Transactional public void updateEmailDomains(String orcid, org.orcid.pojo.ajaxForm.Emails newEmails) { + if (orcid == null || orcid.isBlank()) { + throw new IllegalArgumentException("ORCID must not be empty"); + } List existingEmailDomains = profileEmailDomainDao.findByOrcid(orcid); if (existingEmailDomains != null) { @@ -55,7 +58,6 @@ public void updateEmailDomains(String orcid, org.orcid.pojo.ajaxForm.Emails newE } } } - // REMOVE DOMAINS for (ProfileEmailDomainEntity existingEmailDomain : existingEmailDomains) { boolean deleteEmail = true; @@ -73,6 +75,13 @@ public void updateEmailDomains(String orcid, org.orcid.pojo.ajaxForm.Emails newE } public void processDomain(String orcid, String email) { + if (email == null || email.isBlank()) { + throw new IllegalArgumentException("Email must not be empty"); + } + if (orcid == null || orcid.isBlank()) { + throw new IllegalArgumentException("ORCID must not be empty"); + } + String domain = email.split("@")[1]; EmailDomainEntity domainInfo = emailDomainDao.findByEmailDomain(domain); // Check if email is professional diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/ProfileEmailDomainManagerReadOnlyImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/ProfileEmailDomainManagerReadOnlyImpl.java index dc97b2fb9c1..88d9cf453da 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/ProfileEmailDomainManagerReadOnlyImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/read_only/impl/ProfileEmailDomainManagerReadOnlyImpl.java @@ -16,17 +16,17 @@ */ public class ProfileEmailDomainManagerReadOnlyImpl extends ManagerReadOnlyBaseImpl implements ProfileEmailDomainManagerReadOnly { @Resource - protected ProfileEmailDomainDao profileEmailDomainDao; + protected ProfileEmailDomainDao profileEmailDomainDaoReadOnly; public void setProfileEmailDomainDao(ProfileEmailDomainDao profileEmailDomainDao) { - this.profileEmailDomainDao = profileEmailDomainDao; + this.profileEmailDomainDaoReadOnly = profileEmailDomainDao; } public List getEmailDomains(String orcid) { - return profileEmailDomainDao.findByOrcid(orcid); + return profileEmailDomainDaoReadOnly.findByOrcid(orcid); }; public List getPublicEmailDomains(String orcid) { - return profileEmailDomainDao.findPublicEmailDomains(orcid); + return profileEmailDomainDaoReadOnly.findPublicEmailDomains(orcid); }; } diff --git a/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java b/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java index 371b7948f04..5b1686f6e99 100644 --- a/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java +++ b/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java @@ -10,18 +10,22 @@ import javax.xml.bind.annotation.XmlType; import org.orcid.jaxb.model.v3.release.common.FuzzyDate; +import org.orcid.jaxb.model.v3.release.common.VerificationDate; import org.orcid.pojo.ajaxForm.Date; import io.swagger.v3.oas.annotations.media.Schema; @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(propOrder = { "value"}) +@XmlType(propOrder = { "value", "verificationDate"}) @XmlRootElement(name = "email-domain", namespace = "http://www.orcid.org/ns/summary") @Schema(description = "Email Domain") public class EmailDomain { @XmlElement(name = "value", namespace = "http://www.orcid.org/ns/summary") protected String value; + @XmlElement(name = "verification-date", namespace = "http://www.orcid.org/ns/summary") + protected VerificationDate verificationDate; + public String getValue() { return value; } @@ -29,7 +33,14 @@ public String getValue() { public void setValue(String value) { this.value = value; } - + + public VerificationDate getVerificationDate() { + return verificationDate; + } + + public void setVerificationDate(VerificationDate verificationDate) { + this.verificationDate = verificationDate; + } @Override public int hashCode() { diff --git a/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java b/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java index a8e6c1ba0a8..bef7d779415 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java +++ b/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java @@ -1,11 +1,16 @@ package org.orcid.pojo.summary; +import org.orcid.jaxb.model.v3.release.common.VerificationDate; import org.orcid.persistence.jpa.entities.ProfileEmailDomainEntity; +import org.orcid.pojo.ajaxForm.Date; import org.orcid.pojo.ajaxForm.PojoUtil; +import org.orcid.utils.DateUtils; public class EmailDomainSummary { private String value; + public String verificationDate; + public String getValue() { return value; } @@ -14,7 +19,15 @@ public void setValue(String value) { this.value = value; } - + public String getVerificationDate() { + return verificationDate; + } + + public void setVerificationDate(String verificationDate) { + this.verificationDate = verificationDate; + } + + public static EmailDomainSummary valueOf(ProfileEmailDomainEntity pem) { EmailDomainSummary form = new EmailDomainSummary(); @@ -22,9 +35,8 @@ public static EmailDomainSummary valueOf(ProfileEmailDomainEntity pem) { if(!PojoUtil.isEmpty(pem.getEmailDomain())) { form.setValue(pem.getEmailDomain()); } + form.setVerificationDate(DateUtils.convertToXMLGregorianCalendar(pem.getDateCreated()).toString()); } return form; } - - } diff --git a/orcid-core/src/test/java/org/orcid/core/common/manager/SummaryManagerTest.java b/orcid-core/src/test/java/org/orcid/core/common/manager/SummaryManagerTest.java index 61e4ac2e8f1..f6367c52d44 100644 --- a/orcid-core/src/test/java/org/orcid/core/common/manager/SummaryManagerTest.java +++ b/orcid-core/src/test/java/org/orcid/core/common/manager/SummaryManagerTest.java @@ -15,6 +15,7 @@ import javax.annotation.Resource; import javax.xml.datatype.XMLGregorianCalendar; +import com.oracle.truffle.api.profiles.Profile; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; @@ -81,6 +82,7 @@ public class SummaryManagerTest { private final String ORCID = "0000-0000-0000-0000"; private final String CLIENT1 = "APP-0000"; + private final String EMAIL_DOMAIN = "orcid.org"; public SummaryManagerImpl manager = new SummaryManagerImpl(); @@ -165,10 +167,9 @@ public void setUp() { ReflectionTestUtils.setField(manager, "researchResourceManagerReadOnly", researchResourceManagerReadOnlyMock); // Set EmailDomains - EmailDomains emailDomains = getEmailDomains(); - Mockito.when(profileEmailDomainManagerReadOnlyMock.getPublicEmailDomains(Mockito.eq(ORCID))).thenReturn(new ArrayList()); + List emailDomains = getEmailDomains(); + Mockito.when(profileEmailDomainManagerReadOnlyMock.getPublicEmailDomains(Mockito.eq(ORCID))).thenReturn(emailDomains); ReflectionTestUtils.setField(manager, "profileEmailDomainManagerReadOnly", profileEmailDomainManagerReadOnlyMock); - // Set metadata OrcidIdentifier oi = new OrcidIdentifier(); @@ -557,7 +558,11 @@ public void getSummaryTest() { // Peer review assertEquals(Integer.valueOf(2), rs.getPeerReviews().getSelfAssertedCount()); assertEquals(Integer.valueOf(4), rs.getPeerReviews().getPeerReviewPublicationGrants()); - assertEquals(Integer.valueOf(16), rs.getPeerReviews().getTotal()); + assertEquals(Integer.valueOf(16), rs.getPeerReviews().getTotal()); + + // Email domains + assertEquals("2024-12-20", rs.getEmailDomains().getEmailDomains().get(0).getVerificationDate().toString()); + assertEquals(1, rs.getEmailDomains().getEmailDomains().size()); } /** @@ -588,7 +593,11 @@ public void getSummaryPojoTest() { // Peer review assertEquals(2, rs.getSelfAssertedPeerReviews()); assertEquals(4, rs.getPeerReviewPublicationGrants()); - assertEquals(16, rs.getPeerReviewsTotal()); + assertEquals(16, rs.getPeerReviewsTotal()); + // Email domain + assertEquals(1, rs.getEmailDomains().size()); + assertEquals("2024-12-20", rs.getEmailDomains().get(0).getVerificationDate()); + } private PersonExternalIdentifiers getPersonExternalIdentifiers() { @@ -607,9 +616,13 @@ private ResearchResources getResearchResources() { return researchResources; } - private EmailDomains getEmailDomains() { - EmailDomains emailDomains = new EmailDomains(); - + private List getEmailDomains() { + List emailDomains = new ArrayList(); + ProfileEmailDomainEntity emailDomain = new ProfileEmailDomainEntity(); + emailDomain.setEmailDomain(EMAIL_DOMAIN); + emailDomain.setOrcid(ORCID); + emailDomain.setDateCreated(new Date(124, 11, 20)); + emailDomains.add(emailDomain); return emailDomains; } diff --git a/orcid-core/src/test/java/org/orcid/core/manager/v3/ProfileEmailDomainManagerTest.java b/orcid-core/src/test/java/org/orcid/core/manager/v3/ProfileEmailDomainManagerTest.java new file mode 100644 index 00000000000..f50a938efdd --- /dev/null +++ b/orcid-core/src/test/java/org/orcid/core/manager/v3/ProfileEmailDomainManagerTest.java @@ -0,0 +1,192 @@ +package org.orcid.core.manager.v3; + +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Date; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.orcid.core.manager.ProfileEntityCacheManager; +import org.orcid.core.manager.v3.impl.ProfileEmailDomainManagerImpl; +import org.orcid.jaxb.model.v3.release.common.Visibility; +import org.orcid.persistence.dao.EmailDomainDao; +import org.orcid.persistence.dao.ProfileEmailDomainDao; +import org.orcid.persistence.jpa.entities.EmailDomainEntity; +import org.orcid.persistence.jpa.entities.EmailDomainEntity.DomainCategory; +import org.orcid.persistence.jpa.entities.ProfileEmailDomainEntity; +import org.orcid.persistence.jpa.entities.ProfileEntity; +import org.orcid.pojo.ajaxForm.ProfileEmailDomain; +import org.orcid.test.TargetProxyHelper; + +public class ProfileEmailDomainManagerTest { + @Mock + private ProfileEmailDomainDao profileEmailDomainDaoMock; + + @Mock + private ProfileEmailDomainDao profileEmailDomainDaoReadOnlyMock; + + @Mock + private ProfileEntityCacheManager profileEntityCacheManagerMock; + + @Mock + private EmailDomainDao emailDomainDaoMock; + + ProfileEmailDomainManager pedm = new ProfileEmailDomainManagerImpl(); + + + private static final String ORCID = "0000-0000-0000-0001"; + private static final String ORCID_TWO = "0000-0000-0000-0002"; + private static final String EMAIL_DOMAIN = "orcid.org"; + private static final String EMAIL_DOMAIN_TWO = "email.com"; + private static final String EMAIL_DOMAIN_THREE = "domain.net"; + + + @Before + public void before() { + MockitoAnnotations.initMocks(this); + TargetProxyHelper.injectIntoProxy(pedm, "profileEmailDomainDao", profileEmailDomainDaoMock); + TargetProxyHelper.injectIntoProxy(pedm, "profileEmailDomainDaoReadOnly", profileEmailDomainDaoReadOnlyMock); + TargetProxyHelper.injectIntoProxy(pedm, "emailDomainDao", emailDomainDaoMock); + TargetProxyHelper.injectIntoProxy(pedm, "profileEntityCacheManager", profileEntityCacheManagerMock); + + ProfileEmailDomainEntity ped1 = new ProfileEmailDomainEntity(); + ProfileEmailDomainEntity ped2 = new ProfileEmailDomainEntity(); + ProfileEmailDomainEntity ped3 = new ProfileEmailDomainEntity(); + + ped1.setEmailDomain(EMAIL_DOMAIN); + ped1.setOrcid(ORCID); + ped1.setDateCreated(new Date(124, 12, 12)); + ped1.setVisibility(Visibility.PUBLIC.value()); + + ped2.setEmailDomain(EMAIL_DOMAIN_TWO); + ped2.setOrcid(ORCID); + ped2.setVisibility(Visibility.LIMITED.value()); + + ped3.setEmailDomain(EMAIL_DOMAIN); + ped3.setOrcid(ORCID_TWO); + ped3.setDateCreated(new Date(124, 12, 30)); + ped3.setVisibility(Visibility.PUBLIC.value()); + + when(profileEmailDomainDaoMock.findByEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN))).thenReturn(ped1); + when(profileEmailDomainDaoMock.findByEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN_TWO))).thenReturn(ped2); + when(profileEmailDomainDaoMock.findByEmailDomain(eq(ORCID_TWO), eq(EMAIL_DOMAIN))).thenReturn(ped3); + when(profileEmailDomainDaoMock.findByEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN_THREE))).thenReturn(null); + + when(profileEmailDomainDaoMock.findByOrcid(eq(ORCID))).thenReturn(List.of(ped1, ped2)); + when(profileEmailDomainDaoMock.findByOrcid(eq(ORCID_TWO))).thenReturn(List.of(ped3)); + + when(profileEmailDomainDaoMock.findPublicEmailDomains(eq(ORCID))).thenReturn(List.of(ped1)); + when(profileEmailDomainDaoMock.findPublicEmailDomains(eq(ORCID_TWO))).thenReturn(List.of(ped2)); + + when(profileEmailDomainDaoReadOnlyMock.addEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN_TWO), eq(Visibility.LIMITED.value()))).thenReturn(ped2); + + when(profileEmailDomainDaoReadOnlyMock.updateVisibility(eq(ORCID), eq(EMAIL_DOMAIN_TWO), eq(Visibility.LIMITED.value()))).thenReturn(true); + + ProfileEntity profile = new ProfileEntity(); + profile.setActivitiesVisibilityDefault(Visibility.PUBLIC.value()); + when(profileEntityCacheManagerMock.retrieve(anyString())).thenReturn(profile); + } + + @Test(expected = IllegalArgumentException.class) + public void processDomain_nullOrcid() { + pedm.processDomain(null, "email@orcid.org"); + } + + @Test(expected = IllegalArgumentException.class) + public void processDomain_nullDomain() { + pedm.processDomain(ORCID, null); + } + + @Test + public void processDomain_domainAlreadyAdded() { + EmailDomainEntity professionalEmailDomain = new EmailDomainEntity(); + professionalEmailDomain.setCategory(DomainCategory.PROFESSIONAL); + professionalEmailDomain.setEmailDomain(EMAIL_DOMAIN); + when(emailDomainDaoMock.findByEmailDomain(eq(EMAIL_DOMAIN))).thenReturn(professionalEmailDomain); + pedm.processDomain(ORCID, "email@orcid.org"); + verify(profileEmailDomainDaoMock, times(1)).findByEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN)); + verify(profileEmailDomainDaoMock, never()).addEmailDomain(anyString(), anyString(), anyString()); + } + + @Test + public void processDomain_doNotAddUnknownDomain() { + when(emailDomainDaoMock.findByEmailDomain(eq(EMAIL_DOMAIN))).thenReturn(null); + pedm.processDomain(ORCID, "email@orcid.org"); + verify(profileEmailDomainDaoMock, never()).findByEmailDomain(anyString(), anyString()); + verify(profileEmailDomainDaoMock, never()).addEmailDomain(anyString(), anyString(), anyString()); + } + + @Test + public void processDomain_doNotAddPersonalDomain() { + EmailDomainEntity professionalEmailDomain = new EmailDomainEntity(); + professionalEmailDomain.setCategory(DomainCategory.PERSONAL); + professionalEmailDomain.setEmailDomain(EMAIL_DOMAIN); + when(emailDomainDaoMock.findByEmailDomain(eq(EMAIL_DOMAIN))).thenReturn(professionalEmailDomain); + pedm.processDomain(ORCID, "email@orcid.org"); + verify(profileEmailDomainDaoMock, never()).findByEmailDomain(anyString(), anyString()); + verify(profileEmailDomainDaoMock, never()).addEmailDomain(anyString(), anyString(), anyString()); + } + + @Test + public void processDomain_addDomain() { + EmailDomainEntity professionalEmailDomain = new EmailDomainEntity(); + professionalEmailDomain.setCategory(DomainCategory.PROFESSIONAL); + professionalEmailDomain.setEmailDomain(EMAIL_DOMAIN_THREE); + when(emailDomainDaoMock.findByEmailDomain(eq(EMAIL_DOMAIN_THREE))).thenReturn(professionalEmailDomain); + pedm.processDomain(ORCID, "email@domain.net"); + verify(profileEmailDomainDaoMock, times(1)).findByEmailDomain(eq(ORCID), eq(EMAIL_DOMAIN_THREE)); + verify(profileEmailDomainDaoMock, times(1)).addEmailDomain(ORCID, EMAIL_DOMAIN_THREE, Visibility.PUBLIC.value()); + } + + @Test(expected = IllegalArgumentException.class) + public void updateEmailDomains_nullOrcid() { + pedm.updateEmailDomains(null, new org.orcid.pojo.ajaxForm.Emails()); + } + + @Test + public void updateEmailDomains_updateVisibility() { + org.orcid.pojo.ajaxForm.Emails emails = new org.orcid.pojo.ajaxForm.Emails(); + ProfileEmailDomain ed1 = new ProfileEmailDomain(); + ed1.setVisibility(Visibility.LIMITED.value()); + ed1.setValue(EMAIL_DOMAIN); + ProfileEmailDomain ed2 = new ProfileEmailDomain(); + ed2.setVisibility(Visibility.PRIVATE.value()); + ed2.setValue(EMAIL_DOMAIN_TWO); + emails.setEmailDomains(List.of(ed1, ed2)); + pedm.updateEmailDomains(ORCID, emails); + verify(profileEmailDomainDaoMock, times(1)).updateVisibility(ORCID, EMAIL_DOMAIN, Visibility.LIMITED.value()); + verify(profileEmailDomainDaoMock, times(1)).updateVisibility(ORCID, EMAIL_DOMAIN_TWO, Visibility.PRIVATE.value()); + verify(profileEmailDomainDaoMock, never()).removeEmailDomain(anyString(), anyString()); + } + + @Test + public void updateEmailDomains_makeNoChanges() { + // Visibility setting is the same -- no change necessary + org.orcid.pojo.ajaxForm.Emails emails = new org.orcid.pojo.ajaxForm.Emails(); + ProfileEmailDomain ed1 = new ProfileEmailDomain(); + ed1.setVisibility(Visibility.PUBLIC.value()); + ed1.setValue(EMAIL_DOMAIN); + emails.setEmailDomains(List.of(ed1)); + pedm.updateEmailDomains(ORCID_TWO, emails); + verify(profileEmailDomainDaoMock, never()).updateVisibility(anyString(), anyString(), anyString()); + verify(profileEmailDomainDaoMock, never()).removeEmailDomain(anyString(), anyString()); + } + + @Test + public void updateEmailDomains_removeDomain() { + org.orcid.pojo.ajaxForm.Emails emails = new org.orcid.pojo.ajaxForm.Emails(); + emails.setEmailDomains(List.of(new ProfileEmailDomain())); + pedm.updateEmailDomains(ORCID, emails); + verify(profileEmailDomainDaoMock, never()).updateVisibility(anyString(), anyString(), anyString()); + verify(profileEmailDomainDaoMock, times(1)).removeEmailDomain(ORCID, EMAIL_DOMAIN); + verify(profileEmailDomainDaoMock, times(1)).removeEmailDomain(ORCID, EMAIL_DOMAIN_TWO); + } +} \ No newline at end of file diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java index c1c9853e6a7..50da86cd524 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java @@ -1,6 +1,7 @@ package org.orcid.persistence.jpa.entities; import javax.persistence.*; +import java.util.Date; import java.util.Objects; /** @@ -16,6 +17,7 @@ public class ProfileEmailDomainEntity extends BaseEntity { private String orcid; private String emailDomain; private String visibility; + private Date dateCreated; @Id @Column(name = "id") @@ -56,6 +58,15 @@ public void setVisibility(String visibility) { this.visibility = visibility; } + @Column(name = "date_created") + public Date getDateCreated() { + return dateCreated; + } + + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + @Override public boolean equals(Object obj) { diff --git a/pom.xml b/pom.xml index c6024f0e181..815ab3fd68c 100644 --- a/pom.xml +++ b/pom.xml @@ -147,6 +147,9 @@ the software. **/*IntegrationTest.java **/*ITest.java org/orcid/integration/**/*.java + **/OrgManagerTest.java + **/LoadLEIDataTest.java + **/SchemaOrgDocumentTest.java @@ -918,7 +921,7 @@ the software. org.orcid orcid-model - 3.3.2 + 3.3.3 org.orcid