Methode zu prüfen der Fachlogik in `RecordGenerator` ergänzt und angebunden
[demos/kafka/training] / 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)