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 2e477dcf30..20c8219d48 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 @@ -109,6 +109,12 @@ public class SummaryManagerTest { @Mock private ProfileEntity profileEntityMock; + + @Mock + private ProfileEmailDomainEntity profileEmailDomainEntityMock; + + @Mock + private ProfileEmailDomainEntity profileEmailDomainEntityTwoMock; @Mock private WorksCacheManager worksCacheManagerMock; @@ -561,8 +567,6 @@ public void getSummaryTest() { assertEquals(Integer.valueOf(16), rs.getPeerReviews().getTotal()); // Email domains - assertEquals("2024-12-20", rs.getEmailDomains().getEmailDomains().get(0).getVerificationDate().toString()); - assertEquals(null, rs.getEmailDomains().getEmailDomains().get(1).getVerificationDate()); assertEquals(2, rs.getEmailDomains().getEmailDomains().size()); } @@ -597,9 +601,6 @@ public void getSummaryPojoTest() { assertEquals(16, rs.getPeerReviewsTotal()); // Email domain assertEquals(2, rs.getEmailDomains().size()); - assertEquals("2024-12-20", rs.getEmailDomains().get(0).getVerificationDate()); - assertEquals(null, rs.getEmailDomains().get(1).getVerificationDate()); - } private PersonExternalIdentifiers getPersonExternalIdentifiers() { @@ -619,18 +620,14 @@ private ResearchResources getResearchResources() { } 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); - - ProfileEmailDomainEntity emailDomain2 = new ProfileEmailDomainEntity(); - emailDomain2.setEmailDomain(EMAIL_DOMAIN + "2"); - emailDomain2.setOrcid(ORCID); - emailDomain2.setDateCreated(new Date(124, 9, 20)); - emailDomains.add(emailDomain2); + List emailDomains = new ArrayList<>(); + Mockito.when(profileEmailDomainEntityMock.getEmailDomain()).thenReturn(EMAIL_DOMAIN); + Mockito.when(profileEmailDomainEntityMock.getDateCreated()).thenReturn(new Date(124, 9, 20)); + Mockito.when(profileEmailDomainEntityTwoMock.getEmailDomain()).thenReturn(EMAIL_DOMAIN + "2"); + Mockito.when(profileEmailDomainEntityTwoMock.getDateCreated()).thenReturn(new Date(124, 11, 20)); + + emailDomains.add(profileEmailDomainEntityMock); + emailDomains.add(profileEmailDomainEntityTwoMock); 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 index f50a938efd..62414cbaba 100644 --- 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 @@ -63,7 +63,6 @@ public void before() { ped1.setEmailDomain(EMAIL_DOMAIN); ped1.setOrcid(ORCID); - ped1.setDateCreated(new Date(124, 12, 12)); ped1.setVisibility(Visibility.PUBLIC.value()); ped2.setEmailDomain(EMAIL_DOMAIN_TWO); @@ -72,7 +71,6 @@ public void before() { 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); 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 50da86cd52..0811d46b78 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,7 +1,6 @@ package org.orcid.persistence.jpa.entities; import javax.persistence.*; -import java.util.Date; import java.util.Objects; /** @@ -17,7 +16,6 @@ public class ProfileEmailDomainEntity extends BaseEntity { private String orcid; private String emailDomain; private String visibility; - private Date dateCreated; @Id @Column(name = "id") @@ -58,16 +56,6 @@ 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) { if (this == obj)