Skip to content

Commit

Permalink
Remove mock resets (#8251)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyl3 authored Oct 30, 2024
1 parent 26b324f commit 3799151
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -596,7 +595,6 @@ void getOrgAdminUserIds_skipsUser_forNonExistentUserInOrg() {
private void sendOrgAdminEmailCSVAsyncTest() throws ExecutionException, InterruptedException {
setupDataByFacility();
String type = "facilities";
reset(emailService);
when(oktaRepository.getOktaRateLimitSleepMs()).thenReturn(0);
when(oktaRepository.getOktaOrgsLimit()).thenReturn(1);

Expand All @@ -607,21 +605,18 @@ private void sendOrgAdminEmailCSVAsyncTest() throws ExecutionException, Interrup
List.of("[email protected]", "[email protected]");
verify(emailService, times(1)).sendWithCSVAttachment(expectedMnEmails, "MN", type);
assertThat(mnEmails).isEqualTo(expectedMnEmails);
reset(emailService);

String njExternalId = "d6b3951b-6698-4ee7-9d63-aaadee85bac0";
UUID njId = organizationRepository.findByExternalId(njExternalId).get().getInternalId();
List<String> njEmails = _service.sendOrgAdminEmailCSVAsync(List.of(njId), type, "NJ").get();
List<String> expectedNjEmails = List.of("[email protected]");
verify(emailService, times(1)).sendWithCSVAttachment(expectedNjEmails, "NJ", type);
assertThat(njEmails).isEqualTo(expectedNjEmails);
reset(emailService);

List<String> nonExistentOrgEmails =
_service.sendOrgAdminEmailCSVAsync(List.of(), type, "PA").get();
verify(emailService, times(1)).sendWithCSVAttachment(nonExistentOrgEmails, "PA", type);
assertThat(nonExistentOrgEmails).isEmpty();
reset(emailService);
}

@Test
Expand Down

0 comments on commit 3799151

Please sign in to comment.