6060import org .springframework .kafka .config .KafkaListenerEndpointRegistry ;
6161import org .springframework .kafka .core .ConsumerFactory ;
6262import org .springframework .kafka .listener .ContainerProperties .AckMode ;
63- import org .springframework .kafka .support .KafkaHeaders ;
6463import org .springframework .kafka .test .utils .KafkaTestUtils ;
65- import org .springframework .messaging .handler .annotation .Header ;
6664import org .springframework .test .annotation .DirtiesContext ;
6765import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
6866
@@ -110,7 +108,6 @@ public void doesNotResumeIfPartitionPaused() throws Exception {
110108 verify (this .consumer , never ()).resume (any ());
111109 assertThat (this .config .count ).isEqualTo (4 );
112110 assertThat (this .config .contents ).contains ("foo" , "bar" , "baz" , "qux" );
113- assertThat (this .config .deliveries ).contains (1 , 1 , 1 , 1 );
114111 verify (this .consumer , never ()).seek (any (), anyLong ());
115112 }
116113
@@ -120,8 +117,6 @@ public static class Config {
120117
121118 final List <String > contents = new ArrayList <>();
122119
123- final List <Integer > deliveries = new ArrayList <>();
124-
125120 final CountDownLatch pollLatch = new CountDownLatch (4 );
126121
127122 final CountDownLatch deliveryLatch = new CountDownLatch (4 );
@@ -135,9 +130,8 @@ public static class Config {
135130 @ KafkaListener (id = "id" , groupId = "grp" ,
136131 topicPartitions = @ org .springframework .kafka .annotation .TopicPartition (topic = "foo" ,
137132 partitions = "#{'0,1,2'.split(',')}" ))
138- public void foo (String in , @ Header ( KafkaHeaders . DELIVERY_ATTEMPT ) int delivery ) {
133+ public void foo (String in ) {
139134 this .contents .add (in );
140- this .deliveries .add (delivery );
141135 this .deliveryLatch .countDown ();
142136 if (++this .count == 4 || this .count == 5 ) { // part 1, offset 1, first and second times
143137 throw new RuntimeException ("foo" );
0 commit comments