Skip to content

Commit 10a7647

Browse files
committed
Fix MessageDrivenAdapterTests for partitions
Related to spring-projects/spring-kafka#2891 Starting with Spring for Apache Kafka `3.1`, the `ackMode` for listener container is coerced to `MANUAL` if no `groupId` assigned
1 parent 22c4db2 commit 10a7647

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ void testInboundJsonWithPayload() {
579579
void testPauseResume() throws Exception {
580580
ConsumerFactory<Integer, String> cf = mock(ConsumerFactory.class);
581581
Consumer<Integer, String> consumer = mock(Consumer.class);
582-
given(cf.createConsumer(isNull(), eq("clientId"), isNull(), any())).willReturn(consumer);
582+
given(cf.createConsumer(eq("testPauseResumeGroup"), eq("clientId"), isNull(), any())).willReturn(consumer);
583583
final Map<TopicPartition, List<ConsumerRecord<Integer, String>>> records = new HashMap<>();
584584
records.put(new TopicPartition("foo", 0), Arrays.asList(
585585
new ConsumerRecord<>("foo", 0, 0L, 1, "foo"),
@@ -602,6 +602,7 @@ void testPauseResume() throws Exception {
602602
ContainerProperties containerProps = new ContainerProperties(topicPartition);
603603
containerProps.setAckMode(ContainerProperties.AckMode.RECORD);
604604
containerProps.setClientId("clientId");
605+
containerProps.setGroupId("testPauseResumeGroup");
605606
containerProps.setIdleEventInterval(100L);
606607
BlockingQueue<KafkaEvent> containerEvents = new LinkedBlockingQueue<>();
607608
KafkaMessageListenerContainer<Integer, String> container =

0 commit comments

Comments
 (0)