Skip to content

Commit

Permalink
[JN-1634] Fix flaky testImportEnrolleeMultipleKitRequests assertion (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewBemis authored Feb 28, 2025
1 parent 6f5d29c commit a96073a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.util.*;
import java.util.stream.Collectors;

import static java.util.Comparator.comparing;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.jupiter.api.Assertions.*;
Expand Down Expand Up @@ -1025,9 +1026,12 @@ private void verifySurveyQuestionAnswer(ImportItem importItem, String surveyStab
}

private void verifyKitRequests(ImportItem importItem, List<KitRequestDto> expectedKitRequests) {

List<KitRequestDto> kitRequestDtos = kitRequestService.findByEnrollee(enrolleeService.find(importItem.getCreatedEnrolleeId()).get());
assertThat(kitRequestDtos.size(), equalTo(expectedKitRequests.size()));

kitRequestDtos.sort(comparing(KitRequestDto::getTrackingNumber));
expectedKitRequests.sort(comparing(KitRequestDto::getTrackingNumber));

for (int i = 0; i < expectedKitRequests.size(); i++) {
KitRequestDto kitRequestDto = kitRequestDtos.get(i);
KitRequestDto expectedKit = expectedKitRequests.get(i);
Expand Down

0 comments on commit a96073a

Please sign in to comment.