From f82cc115624d7b5ff818ac7b939deb8591a06263 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Fri, 21 Oct 2022 10:09:46 +0200 Subject: [PATCH] GH-3 - Make tests for DatabaseSchemaInitializer more robust against execution order. The tests previously asserted on no entries being found in the event publication tables. As other tests might have been run before, they could already contain some. --- .../events/jdbc/DatabaseSchemaInitializerIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/test/java/org/springframework/modulith/events/jdbc/DatabaseSchemaInitializerIntegrationTests.java b/spring-modulith-events/spring-modulith-events-jdbc/src/test/java/org/springframework/modulith/events/jdbc/DatabaseSchemaInitializerIntegrationTests.java index 358cdb9e..8e515a26 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/src/test/java/org/springframework/modulith/events/jdbc/DatabaseSchemaInitializerIntegrationTests.java +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/test/java/org/springframework/modulith/events/jdbc/DatabaseSchemaInitializerIntegrationTests.java @@ -63,7 +63,7 @@ void doesNotRegisterAnInitializerBean() { @Test // GH-3 void shouldCreateDatabaseSchemaOnStartUp() { - assertThat(operations.queryForObject(COUNT_PUBLICATIONS, Long.class)).isEqualTo(0); + assertThatNoException().isThrownBy(() -> operations.queryForObject(COUNT_PUBLICATIONS, Long.class)); } }