Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Oct 31, 2024
1 parent 1ddf5e2 commit 8689e4a
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ public class ManageProfileControllerTest {
@Mock
private EmailManager mockEmailManager;

@Mock
private EmailManagerReadOnly mockEmailManagerReadOnly;

@Mock
private ProfileEmailDomainManagerReadOnly mockProfileEmailDomainManagerReadOnly;

Expand Down Expand Up @@ -153,7 +150,7 @@ public void initMocks() throws Exception {
TargetProxyHelper.injectIntoProxy(controller, "profileEntityCacheManager", mockProfileEntityCacheManager);
TargetProxyHelper.injectIntoProxy(controller, "encryptionManager", mockEncryptionManager);
TargetProxyHelper.injectIntoProxy(controller, "emailManager", mockEmailManager);
TargetProxyHelper.injectIntoProxy(controller, "emailManagerReadOnly", mockEmailManagerReadOnly);
TargetProxyHelper.injectIntoProxy(controller, "emailManagerReadOnly", mockEmailManager);
TargetProxyHelper.injectIntoProxy(controller, "profileEmailDomainManagerReadOnly", mockProfileEmailDomainManagerReadOnly);
TargetProxyHelper.injectIntoProxy(controller, "localeManager", mockLocaleManager);
TargetProxyHelper.injectIntoProxy(controller, "profileEntityManager", mockProfileEntityManager);
Expand Down Expand Up @@ -1156,7 +1153,7 @@ public void testEditEmail_primaryEmailChange() {
public void testEmptyEmailSource() {
SecurityContextHolder.getContext().setAuthentication(getAuthentication(USER_ORCID));
when(mockProfileEmailDomainManagerReadOnly.getEmailDomains(eq(USER_ORCID))).thenReturn(null);
when(mockEmailManagerReadOnly.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
when(mockEmailManager.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
MockHttpSession mockSession = new MockHttpSession();
mockRequest.setSession(mockSession);
Expand All @@ -1179,7 +1176,7 @@ public void testEmptyEmailSource() {
public void testEmailSourceWithSourceName() {
SecurityContextHolder.getContext().setAuthentication(getAuthentication(USER_ORCID));
when(mockProfileEmailDomainManagerReadOnly.getEmailDomains(eq(USER_ORCID))).thenReturn(null);
when(mockEmailManagerReadOnly.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
when(mockEmailManager.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
MockHttpSession mockSession = new MockHttpSession();
mockRequest.setSession(mockSession);
Expand All @@ -1197,7 +1194,7 @@ public void testEmailSourceWithSourceName() {
public void testEmailSourceWithSourceId() {
SecurityContextHolder.getContext().setAuthentication(getAuthentication(USER_ORCID));
when(mockProfileEmailDomainManagerReadOnly.getEmailDomains(eq(USER_ORCID))).thenReturn(null);
when(mockEmailManagerReadOnly.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
when(mockEmailManager.getPublicEmails(eq(USER_ORCID))).thenReturn(new Emails());
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
MockHttpSession mockSession = new MockHttpSession();
mockRequest.setSession(mockSession);
Expand Down

0 comments on commit 8689e4a

Please sign in to comment.