Skip to content

Commit 96939da

Browse files
committed
Minor code cleanup in BatchToRecordAdapter tests
1 parent 12e0301 commit 96939da

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/adapter/BatchListenerWithRecordAdapterTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original author or authors.
2+
* Copyright 2019-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@
3838

3939
/**
4040
* @author Gary Russell
41+
* @author Soby Chacko
4142
* @since 2.2.5
4243
*
4344
*/
@@ -52,8 +53,8 @@ void test(@Autowired KafkaListenerEndpointRegistry registry, @Autowired TestList
5253
(BatchMessagingMessageListenerAdapter<String, String>) registry
5354
.getListenerContainer("batchRecordAdapter").getContainerProperties().getMessageListener();
5455
List<ConsumerRecord<String, String>> records = new ArrayList<>();
55-
records.add(new ConsumerRecord<String, String>("foo", 0, 0, null, "foo"));
56-
ConsumerRecord<String, String> barRecord = new ConsumerRecord<String, String>("foo", 0, 1, null, "bar");
56+
records.add(new ConsumerRecord<>("foo", 0, 0, null, "foo"));
57+
ConsumerRecord<String, String> barRecord = new ConsumerRecord<>("foo", 0, 1, null, "bar");
5758
records.add(barRecord);
5859
records.add(new ConsumerRecord<String, String>("foo", 0, 2, null, "baz"));
5960
adapter.onMessage(records, null, null);
@@ -71,10 +72,10 @@ void testFullRecord(@Autowired KafkaListenerEndpointRegistry registry, @Autowire
7172
(BatchMessagingMessageListenerAdapter<String, String>) registry
7273
.getListenerContainer("batchRecordAdapterFullRecord").getContainerProperties().getMessageListener();
7374
List<ConsumerRecord<String, String>> records = new ArrayList<>();
74-
records.add(new ConsumerRecord<String, String>("foo", 0, 0, null, "foo"));
75+
records.add(new ConsumerRecord<>("foo", 0, 0, null, "foo"));
7576
ConsumerRecord<String, String> barRecord = new ConsumerRecord<String, String>("foo", 0, 1, null, "bar");
7677
records.add(barRecord);
77-
records.add(new ConsumerRecord<String, String>("foo", 0, 2, null, "baz"));
78+
records.add(new ConsumerRecord<>("foo", 0, 2, null, "baz"));
7879
adapter.onMessage(records, null, null);
7980
assertThat(foo.values2).contains("foo", "bar", "baz");
8081
assertThat(config.failed).isNull();

0 commit comments

Comments
 (0)