@@ -74,23 +74,15 @@ class SpringBootRabbitSmokeTest {
7474 private static final int TIMEOUT_SECONDS = 60 ;
7575 private static final int RABBIT_AMQP_PORT = 5672 ;
7676 private static final OkHttpClient CLIENT = new OkHttpClient ();
77- private static final String [] MESSAGES = {"foo" , "bar" , "baz" };
7877 // AMQP connection-setup / ack commands each app emits as its own (single-span) trace.
7978 private static final String [] ADMIN_COMMANDS = {
8079 "basic.qos" , "basic.consume" , "basic.ack" , "queue.declare"
8180 };
8281
83- // @Testcontainers starts/stops this static container in the class lifecycle (no static-block
84- // start()); as a class-level @ExtendWith it runs before the @RegisterExtension fields below, so
85- // RabbitMQ is up before the apps launch. Its mapped port is still read lazily at launch via
86- // placeholders, since the container is not yet started when these static fields initialize.
8782 @ Container
8883 private static final RabbitMQContainer RABBIT =
8984 new RabbitMQContainer (DockerImageName .parse ("rabbitmq:3.9.20-alpine" ));
9085
91- // @Order pins the @RegisterExtension order: the shared agent starts before the apps (so its
92- // session is open when the consumers emit startup traces) and is torn down after them.
93- // retainAcrossTests() keeps those startup traces for the one verifying method.
9486 @ Order (1 )
9587 @ RegisterExtension
9688 static final TestAgentBackend agent =
@@ -109,8 +101,9 @@ class SpringBootRabbitSmokeTest {
109101
110102 @ Test
111103 void roundtripsProduceFullAmqpTraceStructure () throws IOException {
112- // Drive 3 round-trips through the sender (matches the Groovy `where:` foo/bar/baz); each
113- // travels sender -> otherqueue -> receiver -> queue -> sender.
104+ // Drive 3 round-trips through the sender;
105+ // Each travels sender -> otherqueue -> receiver -> queue -> sender.
106+ String [] MESSAGES = {"foo" , "bar" , "baz" };
114107 for (String message : MESSAGES ) {
115108 Request request =
116109 new Request .Builder ().url (sender .url () + "/roundtrip/" + message ).get ().build ();
0 commit comments