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
The following commit(s) were added to refs/heads/main by this push: new ac78947 CAMEL-17106: override the component timeout configuration to prevent the test from running slowly ac78947 is described below commit ac789472da45c9094d3a2643c7568a6bc8ab4806 Author: Otavio Rodolfo Piske <opi...@redhat.com> AuthorDate: Tue Oct 19 12:24:24 2021 +0200 CAMEL-17106: override the component timeout configuration to prevent the test from running slowly --- .../apache/camel/component/jms/JmsRouteRequestReplyTest.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteRequestReplyTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteRequestReplyTest.java index 916e043..d8cdbdb 100644 --- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteRequestReplyTest.java +++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteRequestReplyTest.java @@ -390,12 +390,10 @@ public class JmsRouteRequestReplyTest extends CamelTestSupport { @Test public void testUseCorrelationIDTimeout() throws Exception { - JmsComponent c = (JmsComponent) context.getComponent(componentName); - c.getConfiguration().setRequestTimeout(1000); - Object reply = ""; try { - reply = template.requestBody(endpointUriA, request); + // set the timeout for the request, specifically. At this point it is too late to re-configure + template.requestBodyAndHeader(endpointUriA, request, JmsConstants.JMS_REQUEST_TIMEOUT, "1000"); fail("Should have thrown exception"); } catch (RuntimeCamelException e) { assertIsInstanceOf(ExchangeTimedOutException.class, e.getCause()); @@ -405,12 +403,10 @@ public class JmsRouteRequestReplyTest extends CamelTestSupport { @Test public void testUseMessageIDAsCorrelationIDTimeout() throws Exception { - JmsComponent c = (JmsComponent) context.getComponent(componentName); - c.getConfiguration().setRequestTimeout(1000); - Object reply = ""; try { - reply = template.requestBody(endpointUriA, request); + // set the timeout for the request, specifically. At this point it is too late to re-configure + reply = template.requestBodyAndHeader(endpointUriA, request, JmsConstants.JMS_REQUEST_TIMEOUT, "1000"); fail("Should have thrown exception"); } catch (RuntimeCamelException e) { assertIsInstanceOf(ExchangeTimedOutException.class, e.getCause());