Skip to content

Commit

Permalink
adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Jul 24, 2024
1 parent c74bf08 commit 66eb54a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ public void testSetPrimary_primaryEmailChangeAndPrimaryIsNotVerified() {

controller.setPrimary(mockRequest, email);

verify(mockRecordEmailSender, Mockito.times(1)).sendEmailAddressChangedNotification(eq(USER_ORCID), eq("[email protected]"), eq("[email protected]"));
verify(mockRecordEmailSender, Mockito.never()).sendEmailAddressChangedNotification(eq(USER_ORCID), eq("[email protected]"), eq("[email protected]"));
verify(mockRecordEmailSender, Mockito.times(1)).sendVerificationEmail(eq(USER_ORCID), eq("[email protected]"), eq(true));
}

Expand Down Expand Up @@ -1120,7 +1120,7 @@ public void testEditEmail_primaryEmailChange() {
when(mockEmailManager.editEmail(eq(USER_ORCID), eq("[email protected]"), eq("[email protected]"), any())).thenReturn(Map.of("verifyAddress", "[email protected]", "new", "[email protected]", "old", "[email protected]"));
controller.editEmail(mockRequest, email);

verify(mockRecordEmailSender, Mockito.times(1)).sendEmailAddressChangedNotification(eq(USER_ORCID), eq("[email protected]"), eq("[email protected]"));
verify(mockRecordEmailSender, Mockito.never()).sendEmailAddressChangedNotification(eq(USER_ORCID), eq("[email protected]"), eq("[email protected]"));

Check failure on line 1123 in orcid-web/src/test/java/org/orcid/frontend/web/controllers/ManageProfileControllerTest.java

View workflow job for this annotation

GitHub Actions / orcid-web Unit Tests

org.orcid.frontend.web.controllers.ManageProfileControllerTest ► testEditEmail_primaryEmailChange

Failed test found in: TEST-org.orcid.frontend.web.controllers.ManageProfileControllerTest.xml Error: org.mockito.exceptions.verification.NeverWantedButInvoked:
Raw output
org.mockito.exceptions.verification.NeverWantedButInvoked: 

mockRecordEmailSender.sendEmailAddressChangedNotification(
    "0000-0000-0000-0001",
    "[email protected]",
    "[email protected]"
);
Never wanted here:
-> at org.orcid.frontend.web.controllers.ManageProfileControllerTest.testEditEmail_primaryEmailChange(ManageProfileControllerTest.java:1123)
But invoked here:
-> at org.orcid.frontend.web.controllers.ManageProfileController.editEmail(ManageProfileController.java:792)

	at org.orcid.frontend.web.controllers.ManageProfileControllerTest.testEditEmail_primaryEmailChange(ManageProfileControllerTest.java:1123)
verify(mockRecordEmailSender, Mockito.times(1)).sendVerificationEmail(eq(USER_ORCID), eq("[email protected]"), eq(true));
}

Expand Down

0 comments on commit 66eb54a

Please sign in to comment.