From ba0884884e3bfaf770f42d23bad9ad504b39bdec Mon Sep 17 00:00:00 2001 From: Radek Jachimek Date: Tue, 22 Jul 2025 12:48:15 +0200 Subject: [PATCH] Updated the `loadAllClasses` test in `EntitySmokeIT` to ensure proper validation of all entities --- .../dataaccess/entity/EntitySmokeIT.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java b/src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java index acba73a..dd6b2dc 100644 --- a/src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java +++ b/src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java @@ -1,6 +1,6 @@ package com.capgemini.training.appointmentbooking.dataaccess.entity; -import static org.assertj.core.api.Assertions.assertThat; +import org.assertj.core.api.SoftAssertions; import java.util.List; import java.util.Map; @@ -28,10 +28,11 @@ void loadAllClasses() { TreatmentEntity.class, 12, // AppointmentEntity.class, 20); - // when //then - classMap.forEach((entityType, - expectedCount) -> assertThat( - (List) em.createQuery("from " + entityType.getSimpleName()).getResultList()) - .hasSize(expectedCount)); + // when // then + SoftAssertions softly = new SoftAssertions(); + classMap.forEach((entityType, expectedCount) -> softly + .assertThat((List) em.createQuery("from " + entityType.getSimpleName()).getResultList()) + .hasSize(expectedCount)); + softly.assertAll(); } }