|
25 | 25 | import java.util.concurrent.TimeUnit; |
26 | 26 |
|
27 | 27 | import org.aopalliance.aop.Advice; |
| 28 | +import org.apache.commons.logging.Log; |
| 29 | +import org.apache.commons.logging.LogFactory; |
28 | 30 | import org.apache.qpid.protonj2.client.Delivery; |
29 | 31 | import org.apache.qpid.protonj2.client.ReconnectOptions; |
30 | 32 | import org.assertj.core.api.InstanceOfAssertFactories; |
|
34 | 36 |
|
35 | 37 | import org.springframework.amqp.client.AmqpClient; |
36 | 38 | import org.springframework.amqp.client.AmqpConnectionFactory; |
| 39 | +import org.springframework.amqp.client.EnableAmqpTests; |
37 | 40 | import org.springframework.amqp.client.SingleAmqpConnectionFactory; |
38 | 41 | import org.springframework.amqp.client.annotation.AmqpListener; |
39 | 42 | import org.springframework.amqp.client.config.AmqpDefaultConfiguration; |
|
80 | 83 | @DirtiesContext |
81 | 84 | class AmqpListenerAnnotationTests extends AbstractTestContainerTests { |
82 | 85 |
|
| 86 | + static final Log LOG = LogFactory.getLog(AmqpListenerAnnotationTests.class); |
| 87 | + |
83 | 88 | static final String TEST_QUEUE1 = "/queues/listener_annotation1"; |
84 | 89 |
|
85 | 90 | static final String TEST_QUEUE2 = "/queues/listener_annotation2"; |
@@ -198,18 +203,24 @@ void requestReplyAndContainerFactoryOverrides() { |
198 | 203 |
|
199 | 204 | DataIn dataIn = new DataIn("test_data"); |
200 | 205 |
|
201 | | - this.amqpClient.to(TEST_QUEUE2) |
202 | | - .body(dataIn) |
203 | | - .replyTo(TEST_REPLY_TO) |
204 | | - .send(); |
| 206 | + try { |
| 207 | + this.amqpClient.to(TEST_QUEUE2) |
| 208 | + .body(dataIn) |
| 209 | + .replyTo(TEST_REPLY_TO) |
| 210 | + .send(); |
205 | 211 |
|
206 | | - CompletableFuture<DataOut> dataOut = |
207 | | - this.amqpClient.from(TEST_REPLY_TO) |
208 | | - .receiveAndConvert(); |
| 212 | + CompletableFuture<DataOut> dataOut = |
| 213 | + this.amqpClient.from(TEST_REPLY_TO) |
| 214 | + .receiveAndConvert(); |
209 | 215 |
|
210 | | - assertThat(dataOut) |
211 | | - .succeedsWithin(Duration.ofSeconds(30)) |
212 | | - .isEqualTo(new DataOut(dataIn.data + "_out")); |
| 216 | + assertThat(dataOut) |
| 217 | + .succeedsWithin(Duration.ofSeconds(30)) |
| 218 | + .isEqualTo(new DataOut(dataIn.data + "_out")); |
| 219 | + } |
| 220 | + catch (Exception e) { |
| 221 | + LOG.error("LOGS FROM RABBITMQ CONTAINER: " + RABBITMQ.getLogs()); |
| 222 | + throw e; |
| 223 | + } |
213 | 224 | } |
214 | 225 |
|
215 | 226 | @Configuration(proxyBeanMethods = false) |
|
0 commit comments