diff --git a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpAdminTests.java b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpAdminTests.java index 22b6561b..b8a045ab 100644 --- a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpAdminTests.java +++ b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpAdminTests.java @@ -56,13 +56,13 @@ public class RabbitAmqpAdminTests extends RabbitAmqpTestBase { template.convertAndSend("e2", "k2", "test3"), template.convertAndSend("e3", "k3", "test4"), template.convertAndSend("e4", "k4", "test5")); - assertThat(publishFutures).succeedsWithin(Duration.ofSeconds(10)); + assertThat(publishFutures).succeedsWithin(Duration.ofSeconds(20)); - assertThat(template.receiveAndConvert("q1")).succeedsWithin(Duration.ofSeconds(10)).isEqualTo("test1"); - assertThat(template.receiveAndConvert("q2")).succeedsWithin(Duration.ofSeconds(10)).isEqualTo("test2"); - assertThat(template.receiveAndConvert("q2")).succeedsWithin(Duration.ofSeconds(10)).isEqualTo("test3"); - assertThat(template.receiveAndConvert("q3")).succeedsWithin(Duration.ofSeconds(10)).isEqualTo("test4"); - assertThat(template.receiveAndConvert("q4")).succeedsWithin(Duration.ofSeconds(10)).isEqualTo("test5"); + assertThat(template.receiveAndConvert("q1")).succeedsWithin(Duration.ofSeconds(20)).isEqualTo("test1"); + assertThat(template.receiveAndConvert("q2")).succeedsWithin(Duration.ofSeconds(20)).isEqualTo("test2"); + assertThat(template.receiveAndConvert("q2")).succeedsWithin(Duration.ofSeconds(20)).isEqualTo("test3"); + assertThat(template.receiveAndConvert("q3")).succeedsWithin(Duration.ofSeconds(20)).isEqualTo("test4"); + assertThat(template.receiveAndConvert("q4")).succeedsWithin(Duration.ofSeconds(20)).isEqualTo("test5"); assertThat(declarables.getDeclarablesByType(Queue.class)) .hasSize(1) diff --git a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpTemplateTests.java b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpTemplateTests.java index 7cb211c6..49f27bf6 100644 --- a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpTemplateTests.java +++ b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/RabbitAmqpTemplateTests.java @@ -84,10 +84,10 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { this.rabbitAmqpTemplate.setRoutingKey("k1"); assertThat(this.rabbitAmqpTemplate.convertAndSend("test1")) - .succeedsWithin(Duration.ofSeconds(10)); + .succeedsWithin(Duration.ofSeconds(20)); assertThat(this.rabbitAmqpTemplate.receiveAndConvert("q1")) - .succeedsWithin(Duration.ofSeconds(10)) + .succeedsWithin(Duration.ofSeconds(20)) .isEqualTo("test1"); } @@ -97,10 +97,10 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { this.rabbitAmqpTemplate.setReceiveQueue("q1"); assertThat(this.rabbitAmqpTemplate.convertAndSend("test2")) - .succeedsWithin(Duration.ofSeconds(10)); + .succeedsWithin(Duration.ofSeconds(20)); assertThat(this.rabbitAmqpTemplate.receiveAndConvert()) - .succeedsWithin(Duration.ofSeconds(10)) + .succeedsWithin(Duration.ofSeconds(20)) .isEqualTo("test2"); } @@ -119,8 +119,8 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { return testReply; }); - assertThat(rpcServerResult).succeedsWithin(Duration.ofSeconds(10)).isEqualTo(true); - assertThat(rpcClientResult).succeedsWithin(Duration.ofSeconds(10)).isEqualTo(testReply); + assertThat(rpcServerResult).succeedsWithin(Duration.ofSeconds(20)).isEqualTo(true); + assertThat(rpcClientResult).succeedsWithin(Duration.ofSeconds(20)).isEqualTo(testReply); assertThat(receivedRequest.get()).isEqualTo(testRequest); this.template.send("q1", @@ -131,7 +131,7 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { rpcServerResult = this.rabbitAmqpTemplate.receiveAndReply("q1", payload -> "reply-attempt"); - assertThat(rpcServerResult).failsWithin(Duration.ofSeconds(10)) + assertThat(rpcServerResult).failsWithin(Duration.ofSeconds(20)) .withThrowableOfType(ExecutionException.class) .withCauseInstanceOf(AmqpIllegalStateException.class) .withRootCauseInstanceOf(IllegalArgumentException.class) @@ -141,7 +141,7 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { rpcClientResult = this.template.convertSendAndReceive("q1", testRequest); rpcServerResult = this.rabbitAmqpTemplate.receiveAndReply("q1", payload -> null); - assertThat(rpcServerResult).succeedsWithin(Duration.ofSeconds(10)).isEqualTo(false); + assertThat(rpcServerResult).succeedsWithin(Duration.ofSeconds(20)).isEqualTo(false); assertThat(rpcClientResult).failsWithin(Duration.ofSeconds(2)) .withThrowableThat() .isInstanceOf(TimeoutException.class); @@ -149,17 +149,17 @@ public class RabbitAmqpTemplateTests extends RabbitAmqpTestBase { this.template.convertSendAndReceive("q1", new byte[0]); rpcServerResult = this.rabbitAmqpTemplate.receiveAndReply("q1", payload -> payload); - assertThat(rpcServerResult).failsWithin(Duration.ofSeconds(10)) + assertThat(rpcServerResult).failsWithin(Duration.ofSeconds(20)) .withThrowableOfType(ExecutionException.class) .withCauseInstanceOf(AmqpIllegalStateException.class) .withRootCauseInstanceOf(ClassCastException.class) .withMessageContaining("Failed to process RPC request: (Body:'[B") .withStackTraceContaining("class [B cannot be cast to class java.lang.String"); - assertThat(this.template.receiveAndConvert("dlq1")).succeedsWithin(10, TimeUnit.SECONDS) + assertThat(this.template.receiveAndConvert("dlq1")).succeedsWithin(20, TimeUnit.SECONDS) .isEqualTo("non-rpc-request"); - assertThat(this.template.receiveAndConvert("dlq1")).succeedsWithin(10, TimeUnit.SECONDS) + assertThat(this.template.receiveAndConvert("dlq1")).succeedsWithin(20, TimeUnit.SECONDS) .isEqualTo(new byte[0]); } diff --git a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/listener/RabbitAmqpListenerTests.java b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/listener/RabbitAmqpListenerTests.java index 17d68e17..426f8f90 100644 --- a/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/listener/RabbitAmqpListenerTests.java +++ b/spring-rabbitmq-client/src/test/java/org/springframework/amqp/rabbitmq/client/listener/RabbitAmqpListenerTests.java @@ -92,14 +92,14 @@ class RabbitAmqpListenerTests extends RabbitAmqpTestBase { this.template.convertAndSend((random.nextInt(2) == 0 ? "q1" : "q2"), testData); } - assertThat(this.config.consumeIsDone.await(10, TimeUnit.SECONDS)).isTrue(); + assertThat(this.config.consumeIsDone.await(20, TimeUnit.SECONDS)).isTrue(); synchronized (this.config.received) { assertThat(this.config.received).containsAll(testDataList); } - assertThat(this.template.receive("dlq1")).succeedsWithin(10, TimeUnit.SECONDS); - assertThat(this.template.receive("dlq1")).succeedsWithin(10, TimeUnit.SECONDS); + assertThat(this.template.receive("dlq1")).succeedsWithin(20, TimeUnit.SECONDS); + assertThat(this.template.receive("dlq1")).succeedsWithin(20, TimeUnit.SECONDS); } @Test @@ -112,7 +112,7 @@ class RabbitAmqpListenerTests extends RabbitAmqpTestBase { this.template.convertAndSend("q3", testData); } - assertThat(this.config.batchReceived).succeedsWithin(10, TimeUnit.SECONDS) + assertThat(this.config.batchReceived).succeedsWithin(20, TimeUnit.SECONDS) .asInstanceOf(InstanceOfAssertFactories.LIST) .hasSize(5) .containsAll(testDataList); @@ -141,7 +141,7 @@ class RabbitAmqpListenerTests extends RabbitAmqpTestBase { this.template.convertAndSend("q3", testData); } - assertThat(this.config.batchReceived).succeedsWithin(10, TimeUnit.SECONDS) + assertThat(this.config.batchReceived).succeedsWithin(20, TimeUnit.SECONDS) .asInstanceOf(InstanceOfAssertFactories.LIST) .hasSize(10) .containsAll(testDataList); @@ -152,26 +152,26 @@ class RabbitAmqpListenerTests extends RabbitAmqpTestBase { @Test void verifyBasicRequestReply() { CompletableFuture replyFuture = this.template.convertSendAndReceive("requestQueue", "test data"); - assertThat(replyFuture).succeedsWithin(10, TimeUnit.SECONDS).isEqualTo("TEST DATA"); + assertThat(replyFuture).succeedsWithin(20, TimeUnit.SECONDS).isEqualTo("TEST DATA"); } @Test void verifyFutureReturnRequestReply() { CompletableFuture replyFuture = this.template.convertSendAndReceive("requestQueue2", "TEST DATA2"); - assertThat(replyFuture).succeedsWithin(10, TimeUnit.SECONDS).isEqualTo("test data2"); + assertThat(replyFuture).succeedsWithin(20, TimeUnit.SECONDS).isEqualTo("test data2"); } @Test void verifyMonoReturnRequestReply() { CompletableFuture replyFuture = this.template.convertSendAndReceive("requestQueue3", "test data3"); - assertThat(replyFuture).succeedsWithin(10, TimeUnit.SECONDS).isEqualTo("Mono test data3"); + assertThat(replyFuture).succeedsWithin(20, TimeUnit.SECONDS).isEqualTo("Mono test data3"); } @Test void verifyReplyOnAnotherQueue() { this.template.convertAndSend("requestQueue4", "test data4"); CompletableFuture replyFuture = this.template.receiveAndConvert("q4"); - assertThat(replyFuture).succeedsWithin(10, TimeUnit.SECONDS) + assertThat(replyFuture).succeedsWithin(20, TimeUnit.SECONDS) .isEqualTo("Reply for 'test data4' via 'e1' and 'k4'"); }