From e9ff2fd3ae7237b672eec59ac852994574110c59 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Tue, 11 May 2021 09:26:23 -0400 Subject: [PATCH] Test fix --- .../r4/FhirResourceDaoR4ConcurrentWriteTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java index 514a18b91a9..c060fad9327 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java @@ -36,6 +36,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -146,7 +148,19 @@ public class FhirResourceDaoR4ConcurrentWriteTest extends BaseJpaR4Test { } runInTransaction(()->{ - assertEquals(60, myResourceTableDao.count()); + Map counts = new TreeMap<>(); + myResourceTableDao + .findAll() + .stream() + .forEach(t->{ + counts.putIfAbsent(t.getResourceType(), 0); + int value = counts.get(t.getResourceType()); + value++; + counts.put(t.getResourceType(), value); + }); + ourLog.info("Counts: {}", counts); + + assertEquals(60, myResourceTableDao.count(), counts.toString()); }); }