Skip to content

Commit a9024e0

Browse files
committed
Fix timing in the SimpleMessageListenerContainerTests
The `atMost(Duration.ofSeconds(1))` is not enough to satisfy a `500 millis` blocking and further logic afterward.
1 parent 275868e commit a9024e0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainerTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public void testTxSizeAcks() throws Exception {
217217
container.setMessageListener(messages::add);
218218
container.start();
219219
BasicProperties props = new BasicProperties();
220-
byte[] payload = "baz".getBytes();
220+
byte[] payload = "baz" .getBytes();
221221
Envelope envelope = new Envelope(1L, false, "foo", "bar");
222222
consumer.get().handleDelivery("1", envelope, props, payload);
223223
envelope = new Envelope(2L, false, "foo", "bar");
@@ -272,7 +272,7 @@ public void testTxSizeAcksWIthShortSet() throws Exception {
272272
container.afterPropertiesSet();
273273
container.start();
274274
BasicProperties props = new BasicProperties();
275-
byte[] payload = "baz".getBytes();
275+
byte[] payload = "baz" .getBytes();
276276
Envelope envelope = new Envelope(1L, false, "foo", "bar");
277277
consumer.get().handleDelivery(consumerTag, envelope, props, payload);
278278
envelope = new Envelope(2L, false, "foo", "bar");
@@ -753,9 +753,8 @@ void testShutdownWithPendingReplies() {
753753

754754
container.stop();
755755

756-
await().atMost(Duration.ofSeconds(1)).untilAsserted(() ->
757-
verify(logger).warn("Shutdown timeout expired, but 1 pending replies still remain.")
758-
);
756+
await().untilAsserted(() ->
757+
verify(logger).warn("Shutdown timeout expired, but 1 pending replies still remain."));
759758
}
760759

761760
private Answer<Object> messageToConsumer(final Channel mockChannel, final SimpleMessageListenerContainer container,

0 commit comments

Comments
 (0)