Methode zu prüfen der Fachlogik in `RecordGenerator` ergänzt und angebunden
authorKai Moritz <kai@juplo.de>
Sun, 14 Aug 2022 13:40:39 +0000 (15:40 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 14 Aug 2022 16:04:07 +0000 (18:04 +0200)
src/test/java/de/juplo/kafka/GenericApplicationTests.java

index 9175e52..ebad5a8 100644 (file)
@@ -98,6 +98,8 @@ abstract class GenericApplicationTests<K, V>
                assertThatExceptionOfType(IllegalStateException.class)
                                .isThrownBy(() -> endlessConsumer.exitStatus())
                                .describedAs("Consumer should still be running");
+
+               recordGenerator.assertBusinessLogic();
        }
 
        @Test
@@ -133,6 +135,8 @@ abstract class GenericApplicationTests<K, V>
                assertThat(endlessConsumer.exitStatus())
                                .describedAs("Consumer should have exited abnormally")
                                .containsInstanceOf(RecordDeserializationException.class);
+
+               recordGenerator.assertBusinessLogic();
        }
 
        @Test
@@ -168,6 +172,8 @@ abstract class GenericApplicationTests<K, V>
                assertThat(endlessConsumer.exitStatus())
                                .describedAs("Consumer should have exited abnormally")
                                .containsInstanceOf(RuntimeException.class);
+
+               recordGenerator.assertBusinessLogic();
        }
 
 
@@ -255,6 +261,11 @@ abstract class GenericApplicationTests<K, V>
                {
                        return true;
                }
+
+               default void assertBusinessLogic()
+               {
+                       log.debug("No business-logic to assert");
+               }
        }
 
        void sendMessage(ProducerRecord<Bytes, Bytes> record)