This is an automated email from the ASF dual-hosted git repository.

apupier 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 1164a1797764 CAMEL-26600: Fix flaky CxfProducerOperationTest by 
configuring short timeout on wrong endpoint
1164a1797764 is described below

commit 1164a17977646088f482bf79792ea038a4f080e8
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Thu Nov 5 09:14:06 2026 +0100

    CAMEL-26600: Fix flaky CxfProducerOperationTest by configuring short 
timeout on wrong endpoint
    
    Co-authored-by: IBM Bob 2.2.1
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../camel/component/cxf/jaxws/CxfProducerTest.java | 28 +++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
 
b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
index 0da78f0e4790..e27de0cbdfda 100644
--- 
a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
+++ 
b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
@@ -38,8 +38,11 @@ import org.apache.camel.test.AvailablePortFinder;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
 import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 import org.apache.hello_world_soap_http.GreeterImpl;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.AfterEach;
@@ -134,6 +137,24 @@ public class CxfProducerTest {
     @Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
     public void setUp() throws Exception {
         camelContext = new DefaultCamelContext();
+        camelContext.getRegistry().bind("wrongServerConfigurer", new 
CxfConfigurer() {
+            @Override
+            public void configure(AbstractWSDLBasedEndpointFactory 
factoryBean) {
+            }
+
+            @Override
+            public void configureClient(Client client) {
+                HTTPConduit conduit = (HTTPConduit) client.getConduit();
+                HTTPClientPolicy policy = new HTTPClientPolicy();
+                policy.setConnectionTimeout(3000);
+                policy.setReceiveTimeout(3000);
+                conduit.setClient(policy);
+            }
+
+            @Override
+            public void configureServer(Server server) {
+            }
+        });
         camelContext.start();
         template = camelContext.createProducerTemplate();
     }
@@ -143,6 +164,9 @@ public class CxfProducerTest {
     public void tearDown() throws Exception {
         template.stop();
         camelContext.stop();
+        if (wrongPort != null) {
+            wrongPort.release();
+        }
     }
 
     @Test
@@ -212,7 +236,9 @@ public class CxfProducerTest {
     }
 
     protected String getWrongEndpointUri() {
-        return "cxf://" + getWrongServerAddress() + 
"?serviceClass=org.apache.camel.component.cxf.jaxws.HelloService";
+        return "cxf://" + getWrongServerAddress()
+               + 
"?serviceClass=org.apache.camel.component.cxf.jaxws.HelloService"
+               + "&cxfConfigurer=#wrongServerConfigurer";
     }
 
     protected Exchange sendSimpleMessage() {

Reply via email to