Skip to content

Commit ba08848

Browse files
author
Radek Jachimek
committed
Updated the loadAllClasses test in EntitySmokeIT to ensure proper validation of all entities
1 parent d9a72dd commit ba08848

File tree

1 file changed

+7
-6
lines changed
  • src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity

1 file changed

+7
-6
lines changed

src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.capgemini.training.appointmentbooking.dataaccess.entity;
22

3-
import static org.assertj.core.api.Assertions.assertThat;
3+
import org.assertj.core.api.SoftAssertions;
44

55
import java.util.List;
66
import java.util.Map;
@@ -28,10 +28,11 @@ void loadAllClasses() {
2828
TreatmentEntity.class, 12, //
2929
AppointmentEntity.class, 20);
3030

31-
// when //then
32-
classMap.forEach((entityType,
33-
expectedCount) -> assertThat(
34-
(List<?>) em.createQuery("from " + entityType.getSimpleName()).getResultList())
35-
.hasSize(expectedCount));
31+
// when // then
32+
SoftAssertions softly = new SoftAssertions();
33+
classMap.forEach((entityType, expectedCount) -> softly
34+
.assertThat((List<?>) em.createQuery("from " + entityType.getSimpleName()).getResultList())
35+
.hasSize(expectedCount));
36+
softly.assertAll();
3637
}
3738
}

0 commit comments

Comments
 (0)