From b0ac85d99e4a057de41ba57768333bb21d00e4a5 Mon Sep 17 00:00:00 2001 From: jdar Date: Thu, 22 Aug 2024 01:48:52 -0700 Subject: [PATCH] change test back to use assertj --- .../java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java | 7 ++++--- .../jpa/provider/r4/ResourceProviderR4EverythingTest.java | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java index 2d8974a9cde..6f5d8f85a86 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java @@ -26,6 +26,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager import java.util.ArrayList; import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; @@ -294,7 +295,7 @@ public class FhirSearchDaoR4Test extends BaseJpaR4Test { IBundleProvider searchResultBundle = myPatientDao.search(map, mySrd); List resourceIdsFromSearchResult = searchResultBundle.getAllResourceIds(); - assertThat(resourceIdsFromSearchResult, containsInAnyOrder(expectedActivePatientIds)); + assertThat(resourceIdsFromSearchResult).containsExactlyInAnyOrderElementsOf(expectedActivePatientIds); } @Test @@ -328,7 +329,7 @@ public class FhirSearchDaoR4Test extends BaseJpaR4Test { IBundleProvider searchResultBundle = myPatientDao.search(map, mySrd); List resourceIdsFromSearchResult = searchResultBundle.getAllResourceIds(); - assertThat(resourceIdsFromSearchResult, containsInAnyOrder(expectedActivePatientIds)); + assertThat(resourceIdsFromSearchResult).containsExactlyInAnyOrderElementsOf(expectedActivePatientIds); } @Test @@ -363,7 +364,7 @@ public class FhirSearchDaoR4Test extends BaseJpaR4Test { IBundleProvider searchResultBundle = myPatientDao.search(map, mySrd); List resourceIdsFromSearchResult = searchResultBundle.getAllResourceIds(); - assertThat(resourceIdsFromSearchResult, containsInAnyOrder(expectedActivePatientIds)); + assertThat(resourceIdsFromSearchResult).containsExactlyInAnyOrderElementsOf(expectedActivePatientIds); } } diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4EverythingTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4EverythingTest.java index 52628431e18..7a6f5a9eee3 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4EverythingTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4EverythingTest.java @@ -55,6 +55,7 @@ import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -68,6 +69,7 @@ import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; public class ResourceProviderR4EverythingTest extends BaseResourceProviderR4Test {