@@ -120,10 +120,11 @@ public class EnableKafkaIntegrationTests {
120120 public KafkaListenerEndpointRegistry registry ;
121121
122122 @ Autowired
123- private RecordFilterImpl recordFilter ;
123+ private RecordPassAllFilter recordFilter ;
124124
125125 @ Test
126126 public void testSimple () throws Exception {
127+ this .recordFilter .called = false ;
127128 template .send ("annotated1" , 0 , "foo" );
128129 template .flush ();
129130 assertThat (this .listener .latch1 .await (60 , TimeUnit .SECONDS )).isTrue ();
@@ -251,6 +252,7 @@ public void testEmpty() throws Exception {
251252 @ Test
252253 @ SuppressWarnings ("unchecked" )
253254 public void testBatch () throws Exception {
255+ this .recordFilter .called = false ;
254256 ConcurrentMessageListenerContainer <?, ?> container =
255257 (ConcurrentMessageListenerContainer <?, ?>) registry .getListenerContainer ("list1" );
256258 Consumer <?, ?> consumer =
@@ -277,6 +279,7 @@ public void testBatch() throws Exception {
277279 List <?> list = (List <?>) this .listener .payload ;
278280 assertThat (list .size ()).isGreaterThan (0 );
279281 assertThat (list .get (0 )).isInstanceOf (String .class );
282+ assertThat (this .recordFilter .called ).isTrue ();
280283
281284 assertThat (commitLatch .await (10 , TimeUnit .SECONDS )).isTrue ();
282285 }
@@ -388,13 +391,13 @@ public PlatformTransactionManager transactionManager() {
388391 }
389392
390393 @ Bean
391- public RecordFilterImpl recordFilter () {
392- return new RecordFilterImpl ();
394+ public RecordPassAllFilter recordFilter () {
395+ return new RecordPassAllFilter ();
393396 }
394397
395398 @ Bean
396- public RecordFilterImpl manualFilter () {
397- return new RecordFilterImpl ();
399+ public RecordPassAllFilter manualFilter () {
400+ return new RecordPassAllFilter ();
398401 }
399402
400403 @ Bean
@@ -412,6 +415,7 @@ public KafkaListenerContainerFactory<?> batchFactory() {
412415 new ConcurrentKafkaListenerContainerFactory <>();
413416 factory .setConsumerFactory (consumerFactory ());
414417 factory .setBatchListener (true );
418+ factory .setRecordFilterStrategy (recordFilter ());
415419 return factory ;
416420 }
417421
@@ -821,7 +825,7 @@ public void setBar(String bar) {
821825
822826 }
823827
824- public static class RecordFilterImpl implements RecordFilterStrategy <Integer , String > {
828+ public static class RecordPassAllFilter implements RecordFilterStrategy <Integer , String > {
825829
826830 private boolean called ;
827831
0 commit comments