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 bf08781407..9594550614 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 @@ -73,7 +73,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import static org.orcid.core.constants.EmailConstants.VERIFICATION_DATE_CUTOFF; public class SummaryManagerImpl implements SummaryManager { @Resource(name = "recordNameManagerReadOnlyV3") @@ -284,7 +283,7 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) { for (EmailDomain ed : recordSummary.getEmailDomains().getEmailDomains()) { EmailDomainSummary eds = new EmailDomainSummary(); eds.setValue(ed.getValue()); - if (ed.getVerificationDate() != null && ed.getVerificationDate().after(VERIFICATION_DATE_CUTOFF)) { + if (ed.getVerificationDate() != null) { eds.setVerificationDate(ed.getVerificationDate().toString()); } emailDomains.add(eds); @@ -525,8 +524,8 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); ed.setValue(ped.getEmailDomain()); - VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated())); - if (verificationDate.after(VERIFICATION_DATE_CUTOFF)) { + if (!ped.getGeneratedByScript()) { + VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated())); ed.setVerificationDate(verificationDate); } edList.add(ed); diff --git a/orcid-core/src/main/java/org/orcid/core/constants/EmailConstants.java b/orcid-core/src/main/java/org/orcid/core/constants/EmailConstants.java index f3e888300b..ba88933dd1 100644 --- a/orcid-core/src/main/java/org/orcid/core/constants/EmailConstants.java +++ b/orcid-core/src/main/java/org/orcid/core/constants/EmailConstants.java @@ -28,8 +28,6 @@ public class EmailConstants { public static final String DO_NOT_REPLY_VERIFY_ORCID_ORG = "ORCID - Do not reply "; - public static final VerificationDate VERIFICATION_DATE_CUTOFF; - static { XMLGregorianCalendar gregorianCutoffDate = null; VerificationDate verificationDate = null; @@ -46,6 +44,5 @@ public class EmailConstants { throw new RuntimeException("Error initializing XMLGregorianCalendar", e); } - VERIFICATION_DATE_CUTOFF = verificationDate; } } 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..d3af82f2cd 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 @@ -562,7 +562,7 @@ public void getSummaryTest() { // Email domains assertEquals("2024-12-20", rs.getEmailDomains().getEmailDomains().get(0).getVerificationDate().toString()); - assertEquals(null, rs.getEmailDomains().getEmailDomains().get(1).getVerificationDate()); + assertNull(rs.getEmailDomains().getEmailDomains().get(1).getVerificationDate()); assertEquals(2, rs.getEmailDomains().getEmailDomains().size()); } @@ -624,12 +624,14 @@ private List getEmailDomains() { emailDomain.setEmailDomain(EMAIL_DOMAIN); emailDomain.setOrcid(ORCID); emailDomain.setDateCreated(new Date(124, 11, 20)); + emailDomain.setGeneratedByScript(false); emailDomains.add(emailDomain); ProfileEmailDomainEntity emailDomain2 = new ProfileEmailDomainEntity(); emailDomain2.setEmailDomain(EMAIL_DOMAIN + "2"); emailDomain2.setOrcid(ORCID); emailDomain2.setDateCreated(new Date(124, 9, 20)); + emailDomain2.setGeneratedByScript(true); emailDomains.add(emailDomain2); return emailDomains;