`GenericApplicationTest` überspring Tests, wenn Fehler nicht verfügbar
[demos/kafka/training] / src / test / java / de / juplo / kafka / GenericApplicationTest.java
index a6d6aa1..8a57a96 100644 (file)
@@ -100,6 +100,7 @@ abstract class GenericApplicationTest<K, V>
        }
 
        @Test
+       @SkipWhenErrorCannotBeGenerated(poisonPill = true)
        void commitsOffsetOfErrorForReprocessingOnDeserializationError()
        {
                recordGenerator.generate(100, Set.of(77), Set.of(), messageSender);
@@ -133,6 +134,7 @@ abstract class GenericApplicationTest<K, V>
        }
 
        @Test
+       @SkipWhenErrorCannotBeGenerated(logicError = true)
        void doesNotCommitOffsetsOnLogicError()
        {
                recordGenerator.generate(100, Set.of(), Set.of(77), messageSender);
@@ -241,6 +243,16 @@ abstract class GenericApplicationTest<K, V>
                                Set<Integer> poisonPills,
                                Set<Integer> logicErrors,
                                Consumer<ProducerRecord<Bytes, Bytes>> messageSender);
+
+               default boolean canGeneratePoisionPill()
+               {
+                       return true;
+               }
+
+               default boolean canGenerateLogicError()
+               {
+                       return true;
+               }
        }
 
        void sendMessage(ProducerRecord<Bytes, Bytes> record)