Skip to content

Commit 394e10e

Browse files
committed
Reply-to is an address in RabbitMQ 4.2+
References rabbitmq/rabbitmq-server#14474
1 parent 1109cde commit 394e10e

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
package com.rabbitmq.stream.impl;
1616

1717
import static com.rabbitmq.stream.impl.TestUtils.*;
18+
import static com.rabbitmq.stream.impl.TestUtils.BrokerVersion.RABBITMQ_4_2_0;
1819
import static com.rabbitmq.stream.impl.TestUtils.ResponseConditions.ok;
20+
import static com.rabbitmq.stream.impl.TestUtils.atLeastVersion;
1921
import static java.util.Collections.singletonList;
2022
import static java.util.concurrent.TimeUnit.SECONDS;
2123
import static org.assertj.core.api.Assertions.assertThat;
@@ -44,11 +46,10 @@
4446
import java.util.stream.Stream;
4547
import org.apache.commons.lang3.StringUtils;
4648
import org.junit.jupiter.api.TestInfo;
47-
import org.junit.jupiter.api.extension.ExtendWith;
4849
import org.junit.jupiter.params.ParameterizedTest;
4950
import org.junit.jupiter.params.provider.MethodSource;
5051

51-
@ExtendWith(TestUtils.StreamTestInfrastructureExtension.class)
52+
@StreamTestInfrastructure
5253
public class AmqpInteroperabilityTest {
5354

5455
static final Charset UTF8 = StandardCharsets.UTF_8;
@@ -166,7 +167,10 @@ void publishToStreamQueueConsumeFromStream(Codec codec) throws Exception {
166167
.doesNotContainKeys("x-basic-priority")),
167168
ptc(
168169
b -> b.replyTo("reply to"),
169-
m -> assertThat(m.getProperties().getReplyTo()).isEqualTo("reply to")),
170+
m -> {
171+
String expected = brokerVersion42Ormore() ? "/queues/reply%20to" : "reply to";
172+
assertThat(m.getProperties().getReplyTo()).isEqualTo(expected);
173+
}),
170174
ptc(
171175
b -> b.timestamp(timestamp),
172176
m ->
@@ -682,6 +686,10 @@ void messageWithEmptyBodyAndPropertiesShouldBeConvertedInAmqp(Codec codec) throw
682686
}
683687
}
684688

689+
private boolean brokerVersion42Ormore() {
690+
return atLeastVersion(RABBITMQ_4_2_0.version(), brokerVersion);
691+
}
692+
685693
private static class PropertiesTestConfiguration {
686694
final Consumer<AMQP.BasicProperties.Builder> builder;
687695
final Consumer<Message> assertion;

src/test/java/com/rabbitmq/stream/impl/TestUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,8 @@ public enum BrokerVersion {
10951095
RABBITMQ_3_13_0("3.13.0"),
10961096
RABBITMQ_4_0_0("4.0.0"),
10971097
RABBITMQ_4_1_2("4.1.2"),
1098-
RABBITMQ_4_1_4("4.1.4");
1098+
RABBITMQ_4_1_4("4.1.4"),
1099+
RABBITMQ_4_2_0("4.2.0");
10991100

11001101
final String value;
11011102

0 commit comments

Comments
 (0)