This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 721916b861be525d8a158dc4c55bbbe2c8f54021 Author: Nikita Konovalov <nkono...@redhat.com> AuthorDate: Wed Aug 28 11:39:25 2024 +0200 CAMEL-19538: changed some ineffective assertions --- .../MllpTcpClientProducerIdleConnectionTimeoutTest.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerIdleConnectionTimeoutTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerIdleConnectionTimeoutTest.java index 6718eb0a3c4..84e7b0ffd15 100644 --- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerIdleConnectionTimeoutTest.java +++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerIdleConnectionTimeoutTest.java @@ -114,9 +114,9 @@ public class MllpTcpClientProducerIdleConnectionTimeoutTest extends CamelTestSup // Need to send one message to get the connection established source.sendBody(Hl7TestMessageGenerator.generateMessage()); - Awaitility.await().atMost(IDLE_TIMEOUT / 2, TimeUnit.MILLISECONDS).untilAsserted(() -> { - source.sendBody(Hl7TestMessageGenerator.generateMessage()); + source.sendBody(Hl7TestMessageGenerator.generateMessage()); + Awaitility.await().atMost(IDLE_TIMEOUT / 2, TimeUnit.MILLISECONDS).untilAsserted(() -> { assertTrue(done.matches(5, TimeUnit.SECONDS), "Should have completed two exchanges"); MockEndpoint.assertIsSatisfied(context, 5, TimeUnit.SECONDS); @@ -139,18 +139,15 @@ public class MllpTcpClientProducerIdleConnectionTimeoutTest extends CamelTestSup // Need to send one message to get the connection established source.sendBody(Hl7TestMessageGenerator.generateMessage()); - Awaitility.await().atMost(IDLE_TIMEOUT / 2, TimeUnit.MILLISECONDS).untilAsserted(() -> { - source.sendBody(Hl7TestMessageGenerator.generateMessage()); + source.sendBody(Hl7TestMessageGenerator.generateMessage()); - assertTrue(done.matches(5, TimeUnit.SECONDS), "Should have completed two exchanges"); - }); + Awaitility.await().atMost(IDLE_TIMEOUT / 2, TimeUnit.MILLISECONDS) + .untilAsserted(() -> assertTrue(done.matches(5, TimeUnit.SECONDS), "Should have completed two exchanges")); Awaitility.await().untilAsserted(() -> { - assertThrows(MllpJUnitResourceException.class, () -> - mllpServer.checkClientConnections(), + assertThrows(MllpJUnitResourceException.class, () -> mllpServer.checkClientConnections(), "Should receive and exception for the closed connection"); - source.sendBody(Hl7TestMessageGenerator.generateMessage()); MockEndpoint.assertIsSatisfied(context, 5, TimeUnit.SECONDS);