Copilot commented on code in PR #24420:
URL: https://github.com/apache/camel/pull/24420#discussion_r3523960810
##########
components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/RouteIdTransactedIT.java:
##########
@@ -47,7 +50,8 @@ public void testRouteId() throws Exception {
template.sendBody("activemq:queue:RouteIdTransactedTest", "Hello
World");
- MockEndpoint.assertIsSatisfied(context);
+ await().atMost(30, TimeUnit.SECONDS)
+ .untilAsserted(() -> MockEndpoint.assertIsSatisfied(context));
Review Comment:
Wrapping `MockEndpoint.assertIsSatisfied(context)` in Awaitility doesn’t
actually increase the underlying mock assertion timeout (it just retries after
the default per-assert wait). Since `MockEndpoint` already provides a timeout
overload, it’s clearer and more deterministic to set the timeout directly on
the mock assertions for this context.
##########
components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/RouteIdTransactedIT.java:
##########
@@ -61,7 +65,8 @@ public void testRouteIdFailed() throws Exception {
template.sendBody("activemq:queue:RouteIdTransactedTest", "Kaboom");
- MockEndpoint.assertIsSatisfied(context);
+ await().atMost(30, TimeUnit.SECONDS)
+ .untilAsserted(() -> MockEndpoint.assertIsSatisfied(context));
Review Comment:
Same as above: prefer `MockEndpoint.assertIsSatisfied(context, timeout,
unit)` over an Awaitility wrapper so the timeout applies to the underlying mock
endpoint latch rather than relying on retries of the default 10s wait.
##########
components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/RouteIdTransactedIT.java:
##########
@@ -27,6 +29,7 @@
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import static org.awaitility.Awaitility.await;
Review Comment:
If you switch to the `MockEndpoint.assertIsSatisfied(context, 30,
TimeUnit.SECONDS)` overload, the Awaitility static import becomes unused and
should be removed to avoid a compilation failure due to unused imports.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]