Skip to content

Commit 7105774

Browse files
committed
Fix KafkaMessageListenerContainerTests
https://build.spring.io/browse/SK-SK20X-28/
1 parent e08854a commit 7105774

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/KafkaMessageListenerContainerTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.mockito.ArgumentMatchers.any;
2121
import static org.mockito.ArgumentMatchers.anyLong;
22+
import static org.mockito.ArgumentMatchers.eq;
2223
import static org.mockito.ArgumentMatchers.isNull;
2324
import static org.mockito.BDDMockito.given;
2425
import static org.mockito.BDDMockito.willAnswer;
@@ -549,7 +550,7 @@ public void testRecordAckMockForeignThreadImmediate() throws Exception {
549550
private void testRecordAckMockForeignThreadGuts(AckMode ackMode) throws Exception {
550551
ConsumerFactory<Integer, String> cf = mock(ConsumerFactory.class);
551552
Consumer<Integer, String> consumer = mock(Consumer.class);
552-
given(cf.createConsumer(isNull(), eq("clientId"), isNull())).willReturn(consumer);
553+
given(cf.createConsumer(isNull(), eq("clientId"))).willReturn(consumer);
553554
final Map<TopicPartition, List<ConsumerRecord<Integer, String>>> records = new HashMap<>();
554555
records.put(new TopicPartition("foo", 0), Arrays.asList(
555556
new ConsumerRecord<>("foo", 0, 0L, 1, "foo"),
@@ -591,9 +592,9 @@ public void onMessage(ConsumerRecord<Integer, String> data, Acknowledgment ackno
591592
).given(consumer).commitSync(any(Map.class));
592593

593594
containerProps.setMessageListener(messageListener);
594-
containerProps.setClientId("clientId");
595595
KafkaMessageListenerContainer<Integer, String> container =
596596
new KafkaMessageListenerContainer<>(cf, containerProps);
597+
container.setClientIdSuffix("clientId");
597598
container.start();
598599
assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue();
599600
acks.get(1).acknowledge();

0 commit comments

Comments
 (0)