28
28
import org .apache .kafka .clients .consumer .ConsumerRecords ;
29
29
import org .junit .jupiter .api .Test ;
30
30
31
+ import org .springframework .kafka .KafkaException ;
32
+
31
33
/**
32
34
* @author Gary Russell
33
35
* @since 2.7.4
@@ -48,7 +50,7 @@ void testRecordDelegates() {
48
50
eh .handle (wrap (new IOException ()), Collections .emptyList (), mock (Consumer .class ),
49
51
mock (MessageListenerContainer .class ));
50
52
verify (def ).handle (any (), any (), any (), any ());
51
- eh .handle (wrap (new RuntimeException ( )), Collections .emptyList (), mock (Consumer .class ),
53
+ eh .handle (wrap (new KafkaException ( "test" )), Collections .emptyList (), mock (Consumer .class ),
52
54
mock (MessageListenerContainer .class ));
53
55
verify (three ).handle (any (), any (), any (), any ());
54
56
eh .handle (wrap (new IllegalArgumentException ()), Collections .emptyList (), mock (Consumer .class ),
@@ -72,7 +74,7 @@ void testBatchDelegates() {
72
74
eh .handle (wrap (new IOException ()), mock (ConsumerRecords .class ), mock (Consumer .class ),
73
75
mock (MessageListenerContainer .class ), mock (Runnable .class ));
74
76
verify (def ).handle (any (), any (), any (), any (), any ());
75
- eh .handle (wrap (new RuntimeException ( )), mock (ConsumerRecords .class ), mock (Consumer .class ),
77
+ eh .handle (wrap (new KafkaException ( "test" )), mock (ConsumerRecords .class ), mock (Consumer .class ),
76
78
mock (MessageListenerContainer .class ), mock (Runnable .class ));
77
79
verify (three ).handle (any (), any (), any (), any (), any ());
78
80
eh .handle (wrap (new IllegalArgumentException ()), mock (ConsumerRecords .class ), mock (Consumer .class ),
0 commit comments