Skip to content

Commit

Permalink
removed user access check for updating member language
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcaprice committed Aug 7, 2023
1 parent 6a42c14 commit a5b9d7f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ public MemberOrgIds getCurrentMemberOrgIds(String salesforceId) throws Unauthori
}

public void updateMemberDefaultLanguage(String salesforceId, String language) throws UnauthorizedMemberAccessException {
LOG.info("Logged in user is {}, language is {}", userService.getLoggedInUser().getEmail());
validateUserAccess(salesforceId);
Optional<Member> optional = memberRepository.findBySalesforceId(salesforceId);
if (optional.isPresent()) {
Member member = optional.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,6 @@ void testUpdateMemberDefaultLanguage() throws UnauthorizedMemberAccessException
assertThat(captured.getDefaultLanguage()).isEqualTo("en");
}

@Test
void testUpdateMemberDefaultLanguage_illegalAccess() {
Member member = getMember();
Mockito.when(memberRepository.findBySalesforceId(Mockito.eq("wrongSalesforceId"))).thenReturn(Optional.of(member));

Assertions.assertThrows(UnauthorizedMemberAccessException.class, () -> {
memberService.updateMemberDefaultLanguage("wrongSalesforceId", "en");
});
Mockito.verify(memberRepository, Mockito.never()).save(Mockito.any(Member.class));
}

@Test
void testProcessMemberContact_add() throws UnauthorizedMemberAccessException {
Mockito.doNothing().when(mailService).sendUpdateContactEmail(Mockito.any(MemberContactUpdate.class));
Expand Down

0 comments on commit a5b9d7f

Please sign in to comment.