-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Update claim and reactivate methods to receive orcid and sen…
…d email to associated email
- Loading branch information
Daniel Palafox
committed
Mar 14, 2024
1 parent
fa9dd3e
commit 997b708
Showing
3 changed files
with
76 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
import org.orcid.frontend.email.RecordEmailSender; | ||
import org.orcid.jaxb.model.common.AvailableLocales; | ||
import org.orcid.jaxb.model.v3.release.common.Visibility; | ||
import org.orcid.jaxb.model.v3.release.record.Email; | ||
import org.orcid.persistence.jpa.entities.ProfileEntity; | ||
import org.orcid.pojo.EmailRequest; | ||
import org.orcid.pojo.ajaxForm.Checkbox; | ||
|
@@ -96,6 +97,21 @@ public void testResendEmailFailIfTheProfileIsAlreadyClaimed() { | |
assertFalse(emailRequest.getErrors().isEmpty()); | ||
} | ||
|
||
@Test | ||
public void testResendClaimEmailByOrcid() { | ||
BindingResult bindingResult = mock(BindingResult.class); | ||
when(bindingResult.hasErrors()).thenReturn(false); | ||
Email email = new Email(); | ||
email.setEmail("[email protected]"); | ||
when(emailManager.findPrimaryEmail("0000-0000-0000-0000")).thenReturn(email); | ||
when(profileEntityCacheManager.retrieve(Mockito.anyString())).thenReturn(getProfileEntityToTestClaimResend(false)); | ||
EmailRequest emailRequest = new EmailRequest(); | ||
emailRequest.setEmail("0000-0000-0000-0000"); | ||
emailRequest = claimController.resendClaimEmail(emailRequest); | ||
assertNotNull(emailRequest); | ||
assertNotNull(emailRequest.getSuccessMessage()); | ||
} | ||
|
||
@Test | ||
public void testResendClaimEmail() { | ||
BindingResult bindingResult = mock(BindingResult.class); | ||
|