You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/04/06 12:34:06 UTC

[camel-quarkus] branch 2.13.x updated (92ba2e6d56 -> 9373d7615c)

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

jamesnetherton pushed a change to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


    from 92ba2e6d56 Fix #4710 to register reflection for FastStringBuffer and resource bundle for XMLErrorResources (#4720)
     new ad9c3b1f25 Ref #4596: Expand JDBC tests - named parameters and samples (#4655)
     new 235a7583e2 Add missing @Component annotation to QuarkusVertxWebsocketComponent
     new 9996da71d2 Regenerate virtualDependencies profiles
     new 978cf22f25 Upgrade to CXF test container quay.io/l2x6/calculator-ws:1.1
     new 1da852309f Test CXF client with HTTP BASIC authentication #4705
     new 9373d7615c Cxf-soap: Extend test coverage with Ssl scenario #4679

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../vertx/websocket/VertxWebsocketRecorder.java    |   2 +
 .../cxf-soap/cxf-soap-client/pom.xml               |   4 +
 .../cxf/soap/client/it/CxfSoapClientResource.java  |  34 ++-
 .../cxf/soap/client/it/CxfSoapClientRoutes.java    |  20 ++
 .../wsdl/BasicAuthCalculatorService.wsdl}          |  42 +--
 .../src/main/resources/wsdl/CalculatorService.wsdl | 188 ++++++++++---
 .../cxf/soap/client/it/CxfClientTestResource.java  |  11 +-
 .../cxf/soap/client/it/CxfSoapClientTest.java      |  57 ++--
 .../pom.xml                                        | 176 +++++++-----
 .../cxf/soap/ssl/it/CxfSoapSslResource.java        |  61 +++--
 .../cxf/soap/ssl/it/CxfSoapSslRoutes.java          | 210 ++++++++++++++
 .../component/cxf/soap/ssl/it/GreeterImpl.java     |   9 +-
 .../component/cxf/soap/ssl/it/GreeterService.java} |  10 +-
 .../src/main/resources/application.properties      |   6 +-
 .../cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java |   4 +-
 .../soap/ssl/it/CxfSoapGlobalTrustedSslTest.java   |  31 +--
 .../soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java}  |   5 +-
 .../soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java |  31 +--
 .../component/cxf/soap/ssl/it/CxfSoapSslIT.java}   |   5 +-
 .../component/cxf/soap/ssl/it/CxfSoapSslTest.java  |  65 +++++
 .../soap/wss/client/it/CxfSoapWssClientTest.java   |  16 +-
 .../wss/client/it/CxfWssClientTestResource.java    |   2 +-
 integration-test-groups/cxf-soap/pom.xml           |   1 +
 integration-test-groups/foundation/ref/pom.xml     |   2 +-
 integration-tests/cxf-soap-grouped/pom.xml         | 302 +++++++++++++++++++++
 integration-tests/jdbc/pom.xml                     |  80 +++++-
 .../quarkus/component/jdbc/CamelResource.java      |  78 +++++-
 .../camel/quarkus/component/jdbc/JdbcRoutes.java   |  67 +++++
 .../quarkus/component/jdbc/CamelJdbcTest.java      | 111 ++++++++
 29 files changed, 1381 insertions(+), 249 deletions(-)
 copy integration-test-groups/cxf-soap/{cxf-soap-ws-security-client/src/main/resources/wsdl/WssCalculatorService.wsdl => cxf-soap-client/src/main/resources/wsdl/BasicAuthCalculatorService.wsdl} (54%)
 copy integration-test-groups/cxf-soap/{cxf-soap-ws-security-client => cxf-soap-ssl}/pom.xml (52%)
 copy integration-tests/tika/src/main/java/org/apache/camel/quarkus/component/tika/it/TikaResource.java => integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslResource.java (52%)
 create mode 100644 integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslRoutes.java
 copy integration-tests-support/xslt-support/src/main/java/org/apache/camel/quarkus/test/support/xslt/Functions.java => integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterImpl.java (79%)
 copy integration-test-groups/cxf-soap/{cxf-soap-mtom-awt/src/main/java/org/apache/camel/quarkus/component/cxf/soap/mtom/awt/it/IImageService.java => cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterService.java} (81%)
 copy integration-test-groups/cxf-soap/{cxf-soap-mtom => cxf-soap-ssl}/src/main/resources/application.properties (77%)
 copy integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailIT.java => integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java (87%)
 copy integration-tests/jms-artemis-client/src/test/java/org/apache/camel/quarkus/component/jms/artemis/it/JmsArtemisXATest.java => integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslTest.java (61%)
 copy integration-test-groups/{aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbIT.java => cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java} (86%)
 copy integration-tests/jms-artemis-client/src/test/java/org/apache/camel/quarkus/component/jms/artemis/it/JmsArtemisXATest.java => integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java (59%)
 copy integration-test-groups/{aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbIT.java => cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslIT.java} (89%)
 create mode 100644 integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslTest.java
 create mode 100644 integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/JdbcRoutes.java


[camel-quarkus] 03/06: Regenerate virtualDependencies profiles

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 9996da71d241c6212dfc78170da6cee1f9852dff
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Apr 6 07:45:50 2023 +0100

    Regenerate virtualDependencies profiles
---
 integration-test-groups/foundation/ref/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/integration-test-groups/foundation/ref/pom.xml b/integration-test-groups/foundation/ref/pom.xml
index c0399afd5f..44d41f5f33 100644
--- a/integration-test-groups/foundation/ref/pom.xml
+++ b/integration-test-groups/foundation/ref/pom.xml
@@ -126,7 +126,7 @@
                 </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
-                    <artifactId>camel-quarkus-seda</artifactId>
+                    <artifactId>camel-quarkus-seda-deployment</artifactId>
                     <version>${project.version}</version>
                     <type>pom</type>
                     <scope>test</scope>


[camel-quarkus] 05/06: Test CXF client with HTTP BASIC authentication #4705

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 1da852309f3adf254674da471a63bfba052654c6
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Tue Mar 28 17:58:37 2023 +0200

    Test CXF client with HTTP BASIC authentication #4705
---
 .../cxf-soap/cxf-soap-client/pom.xml               |  4 ++
 .../cxf/soap/client/it/CxfSoapClientRoutes.java    | 20 ++++++
 .../resources/wsdl/BasicAuthCalculatorService.wsdl | 75 ++++++++++++++++++++++
 .../cxf/soap/client/it/CxfClientTestResource.java  |  9 ++-
 .../cxf/soap/client/it/CxfSoapClientTest.java      | 41 ++++++++++--
 5 files changed, 142 insertions(+), 7 deletions(-)

diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/pom.xml b/integration-test-groups/cxf-soap/cxf-soap-client/pom.xml
index 234870240c..71d6b78a78 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/pom.xml
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/pom.xml
@@ -46,6 +46,10 @@
                                     <wsdl>${basedir}/src/main/resources/wsdl/CalculatorService.wsdl</wsdl>
                                     <wsdlLocation>classpath:wsdl/CalculatorService.wsdl</wsdlLocation>
                                 </wsdlOption>
+                                <wsdlOption>
+                                    <wsdl>${basedir}/src/main/resources/wsdl/BasicAuthCalculatorService.wsdl</wsdl>
+                                    <wsdlLocation>classpath:wsdl/BasicAuthCalculatorService.wsdl</wsdlLocation>
+                                </wsdlOption>
                             </wsdlOptions>
                         </configuration>
                     </execution>
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientRoutes.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientRoutes.java
index 1f82daac7a..413546cc3d 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientRoutes.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientRoutes.java
@@ -36,6 +36,7 @@ import org.apache.camel.component.cxf.common.message.CxfConstants;
 import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
 import org.apache.cxf.ext.logging.LoggingFeature;
 import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.jboss.eap.quickstarts.wscalculator.basicauthcalculator.BasicAuthCalculatorService;
 import org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService;
 
 @ApplicationScoped
@@ -90,6 +91,13 @@ public class CxfSoapClientRoutes extends RouteBuilder {
         from("direct:operandsAdd")
                 .setHeader(CxfConstants.OPERATION_NAME).constant("addOperands")
                 .to("cxf:bean:soapClientEndpoint?dataFormat=POJO");
+
+        from("direct:basicAuthAdd")
+                .to("cxf:bean:basicAuthClientEndpoint?dataFormat=POJO&username={{cq.cxf.it.calculator.auth.basic.user}}&password={{cq.cxf.it.calculator.auth.basic.password}}");
+
+        from("direct:basicAuthAddAnonymous")
+                .to("cxf:bean:basicAuthClientEndpoint?dataFormat=POJO");
+
     }
 
     @Produces
@@ -113,6 +121,18 @@ public class CxfSoapClientRoutes extends RouteBuilder {
         return result;
     }
 
+    @Produces
+    @SessionScoped
+    @Named
+    CxfEndpoint basicAuthClientEndpoint() {
+        final CxfEndpoint result = new CxfEndpoint();
+        result.setServiceClass(BasicAuthCalculatorService.class);
+        result.setAddress(serviceBaseUri + "/calculator-ws/BasicAuthCalculatorService");
+        result.setWsdlURL("wsdl/BasicAuthCalculatorService.wsdl");
+        result.getFeatures().add(loggingFeature);
+        return result;
+    }
+
     private String calculatorServiceAddress() {
         return serviceBaseUri + "/calculator-ws/CalculatorService";
     }
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/BasicAuthCalculatorService.wsdl b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/BasicAuthCalculatorService.wsdl
new file mode 100644
index 0000000000..10ffef8a1d
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/BasicAuthCalculatorService.wsdl
@@ -0,0 +1,75 @@
+<?xml version="1.0" ?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.jboss.org/eap/quickstarts/wscalculator/BasicAuthCalculator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="BasicAuthCalculatorService" targetNamespace="http://www.jboss.org/eap/quickstarts/wscalculator/BasicAuthCalculator">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+  <wsdl:types>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.jboss.org/eap/quickstarts/wscalculator/BasicAuthCalculator" elementFormDefault="unqualified" targetNamespace="http://www.jboss.org/eap/quickstarts/wscalculator/BasicAuthCalculator" version="1.0">
+
+  <xs:element name="securedAdd" type="tns:securedAdd"></xs:element>
+
+  <xs:element name="securedAddResponse" type="tns:securedAddResponse"></xs:element>
+
+  <xs:complexType name="securedAdd">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:int"></xs:element>
+      <xs:element name="arg1" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="securedAddResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="securedAddResponse">
+    <wsdl:part element="tns:securedAddResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="securedAdd">
+    <wsdl:part element="tns:securedAdd" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="BasicAuthCalculatorService">
+    <wsdl:operation name="securedAdd">
+      <wsdl:input message="tns:securedAdd" name="securedAdd">
+    </wsdl:input>
+      <wsdl:output message="tns:securedAddResponse" name="securedAddResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="BasicAuthCalculatorServiceSoapBinding" type="tns:BasicAuthCalculatorService">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
+    <wsdl:operation name="securedAdd">
+      <soap:operation soapAction="" style="document"></soap:operation>
+      <wsdl:input name="securedAdd">
+        <soap:body use="literal"></soap:body>
+      </wsdl:input>
+      <wsdl:output name="securedAddResponse">
+        <soap:body use="literal"></soap:body>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="BasicAuthCalculatorService">
+    <wsdl:port binding="tns:BasicAuthCalculatorServiceSoapBinding" name="BasicAuthCalculator">
+      <soap:address location="http://192.168.122.1:8080/calculator-ws/BasicAuthCalculatorService"></soap:address>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
index d8ff5eba2c..2d08a62502 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
@@ -18,6 +18,7 @@
 package org.apache.camel.quarkus.component.cxf.soap.client.it;
 
 import java.util.Map;
+import java.util.UUID;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
 import org.slf4j.Logger;
@@ -34,10 +35,14 @@ public class CxfClientTestResource implements QuarkusTestResourceLifecycleManage
 
     @Override
     public Map<String, String> start() {
+        final String BASIC_AUTH_USER = "tester";
+        final String BASIC_AUTH_PASSWORD = UUID.randomUUID().toString();
 
         try {
             calculatorContainer = new GenericContainer<>("quay.io/l2x6/calculator-ws:1.1")
                     .withExposedPorts(WILDFLY_PORT)
+                    .withEnv("BASIC_AUTH_USER", BASIC_AUTH_USER)
+                    .withEnv("BASIC_AUTH_PASSWORD", BASIC_AUTH_PASSWORD)
                     .withLogConsumer(new Slf4jLogConsumer(log))
                     .waitingFor(Wait.forHttp("/calculator-ws/CalculatorService?wsdl"));
 
@@ -46,7 +51,9 @@ public class CxfClientTestResource implements QuarkusTestResourceLifecycleManage
             return Map.of(
                     "camel-quarkus.it.calculator.baseUri",
                     "http://" + calculatorContainer.getHost() + ":" +
-                            calculatorContainer.getMappedPort(WILDFLY_PORT));
+                            calculatorContainer.getMappedPort(WILDFLY_PORT),
+                    "cq.cxf.it.calculator.auth.basic.user", BASIC_AUTH_USER,
+                    "cq.cxf.it.calculator.auth.basic.password", BASIC_AUTH_PASSWORD);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
index ad9d1cb0e4..f17e279f7c 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
@@ -34,6 +34,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
+import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.equalTo;
 
 @QuarkusTest
@@ -81,23 +82,51 @@ class CxfSoapClientTest {
                 .body(equalTo("7"));
     }
 
+    @Test
+    public void basicAuthClient() {
+        RestAssured.given()
+                .queryParam("a", "7")
+                .queryParam("b", "8")
+                .queryParam("endpointUri", "basicAuthAdd")
+                .queryParam("operation", "securedAdd")
+                .post("/cxf-soap/client/simple")
+                .then()
+                .statusCode(201)
+                .body(equalTo("15"));
+    }
+
+    @Test
+    public void basicAuthClientAnonymous() {
+        RestAssured.given()
+                .queryParam("a", "7")
+                .queryParam("b", "8")
+                .queryParam("endpointUri", "basicAuthAddAnonymous")
+                .queryParam("operation", "securedAdd")
+                .post("/cxf-soap/client/simple")
+                .then()
+                .statusCode(500)
+                .body(containsString("HTTP response '401: Unauthorized'"));
+    }
+
     /**
-     * Make sure that our static copy is the same as the WSDL served by the container
+     * Make sure that our static copies are the same as the WSDLs served by the container
      *
      * @throws IOException
      */
-    @Test
-    void wsdlUpToDate() throws IOException {
+    @ParameterizedTest
+    @ValueSource(strings = { "CalculatorService", "BasicAuthCalculatorService" })
+    void wsdlUpToDate(String serviceName) throws IOException {
         final String wsdlUrl = ConfigProvider.getConfig()
                 .getValue("camel-quarkus.it.calculator.baseUri", String.class);
 
-        final String wsdlRelPath = "wsdl/CalculatorService.wsdl";
+        final String wsdlRelPath = "wsdl/" + serviceName + ".wsdl";
         final Path staticCopyPath = Paths.get("src/main/resources/" + wsdlRelPath);
         Assumptions.assumeTrue(Files.isRegularFile(staticCopyPath),
                 staticCopyPath + " does not exist - we probably run inside Quarkus Platform");
 
         /* The changing Docker IP address in the WSDL should not matter */
-        final String sanitizerRegex = "<soap:address location=\"http://[^/]*/calculator-ws/CalculatorService\"></soap:address>";
+        final String sanitizerRegex = "<soap:address location=\"http://[^/]*/calculator-ws/" + serviceName
+                + "\"></soap:address>";
         final String staticCopyContent = Files
                 .readString(staticCopyPath, StandardCharsets.UTF_8)
                 .replaceAll(sanitizerRegex, "")
@@ -107,7 +136,7 @@ class CxfSoapClientTest {
                 .replaceAll("\\s", "");
 
         final String expected = RestAssured.given()
-                .get(wsdlUrl + "/calculator-ws/CalculatorService?wsdl")
+                .get(wsdlUrl + "/calculator-ws/" + serviceName + "?wsdl")
                 .then()
                 .statusCode(200)
                 .extract().body().asString();


[camel-quarkus] 04/06: Upgrade to CXF test container quay.io/l2x6/calculator-ws:1.1

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 978cf22f25664185e0f1da495b50537f750e84cd
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Tue Mar 28 16:30:15 2023 +0200

    Upgrade to CXF test container quay.io/l2x6/calculator-ws:1.1
---
 .../cxf/soap/client/it/CxfSoapClientResource.java  |  34 +++-
 .../src/main/resources/wsdl/CalculatorService.wsdl | 188 +++++++++++++++++----
 .../cxf/soap/client/it/CxfClientTestResource.java  |   2 +-
 .../cxf/soap/client/it/CxfSoapClientTest.java      |  16 +-
 .../soap/wss/client/it/CxfSoapWssClientTest.java   |  16 +-
 .../wss/client/it/CxfWssClientTestResource.java    |   2 +-
 6 files changed, 191 insertions(+), 67 deletions(-)

diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientResource.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientResource.java
index 4ecee01f68..5732a8543a 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientResource.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientResource.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.quarkus.component.cxf.soap.client.it;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.net.URI;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -30,7 +32,9 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.cxf.common.message.CxfConstants;
 import org.jboss.eap.quickstarts.wscalculator.calculator.Operands;
 import org.jboss.eap.quickstarts.wscalculator.calculator.Result;
 
@@ -45,14 +49,28 @@ public class CxfSoapClientResource {
     @POST
     @Consumes(MediaType.WILDCARD)
     @Produces(MediaType.TEXT_PLAIN)
-    public Response sendSimpleRequest(@QueryParam("a") int a,
-            @QueryParam("b") int b, @QueryParam("endpointUri") String endpointUri) throws Exception {
-        final String response = producerTemplate.requestBody(String.format("direct:%s", endpointUri), new int[] { a, b },
-                String.class);
-        return Response
-                .created(new URI("https://camel.apache.org/"))
-                .entity(response)
-                .build();
+    public Response sendSimpleRequest(
+            @QueryParam("a") int a,
+            @QueryParam("b") int b,
+            @QueryParam("endpointUri") String endpointUri,
+            @QueryParam("operation") String operation) throws Exception {
+        try {
+            final String response = producerTemplate.requestBodyAndHeader(
+                    String.format("direct:%s", endpointUri),
+                    new int[] { a, b },
+                    CxfConstants.OPERATION_NAME,
+                    operation,
+                    String.class);
+            return Response
+                    .created(new URI("https://camel.apache.org/"))
+                    .entity(response)
+                    .build();
+        } catch (CamelExecutionException e) {
+            try (StringWriter stackTrace = new StringWriter(); PrintWriter out = new PrintWriter(stackTrace)) {
+                e.printStackTrace(out);
+                return Response.serverError().entity(stackTrace.toString()).build();
+            }
+        }
     }
 
     @Path("/simpleAddDataFormat")
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/CalculatorService.wsdl b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/CalculatorService.wsdl
index 2b0be31507..43455b0449 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/CalculatorService.wsdl
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/main/resources/wsdl/CalculatorService.wsdl
@@ -22,6 +22,18 @@
 
   <xs:element name="add" type="tns:add"></xs:element>
 
+  <xs:element name="addArray" type="tns:addArray"></xs:element>
+
+  <xs:element name="addArrayResponse" type="tns:addArrayResponse"></xs:element>
+
+  <xs:element name="addList" type="tns:addList"></xs:element>
+
+  <xs:element name="addListResponse" type="tns:addListResponse"></xs:element>
+
+  <xs:element name="addNumberAndOperands" type="tns:addNumberAndOperands"></xs:element>
+
+  <xs:element name="addNumberAndOperandsResponse" type="tns:addNumberAndOperandsResponse"></xs:element>
+
   <xs:element name="addOperands" type="tns:addOperands"></xs:element>
 
   <xs:element name="addOperandsResponse" type="tns:addOperandsResponse"></xs:element>
@@ -40,27 +52,26 @@
 
   <xs:element name="subtractResponse" type="tns:subtractResponse"></xs:element>
 
-  <xs:complexType name="divide">
+  <xs:complexType name="add">
     <xs:sequence>
       <xs:element name="arg0" type="xs:int"></xs:element>
       <xs:element name="arg1" type="xs:int"></xs:element>
     </xs:sequence>
   </xs:complexType>
 
-  <xs:complexType name="divideResponse">
+  <xs:complexType name="addResponse">
     <xs:sequence>
       <xs:element name="return" type="xs:int"></xs:element>
     </xs:sequence>
   </xs:complexType>
 
-  <xs:complexType name="add">
+  <xs:complexType name="addArray">
     <xs:sequence>
-      <xs:element name="arg0" type="xs:int"></xs:element>
-      <xs:element name="arg1" type="xs:int"></xs:element>
+      <xs:element maxOccurs="unbounded" minOccurs="0" name="arg0" type="xs:int"></xs:element>
     </xs:sequence>
   </xs:complexType>
 
-  <xs:complexType name="addResponse">
+  <xs:complexType name="addArrayResponse">
     <xs:sequence>
       <xs:element name="return" type="xs:int"></xs:element>
     </xs:sequence>
@@ -79,9 +90,35 @@
     </xs:sequence>
   </xs:complexType>
 
-  <xs:complexType name="addOperands">
+  <xs:complexType name="divide">
     <xs:sequence>
-      <xs:element minOccurs="0" name="arg0" type="tns:operands"></xs:element>
+      <xs:element name="arg0" type="xs:int"></xs:element>
+      <xs:element name="arg1" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="divideResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="addList">
+    <xs:sequence>
+      <xs:element maxOccurs="unbounded" minOccurs="0" name="arg0" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="addListResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="addNumberAndOperands">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:int"></xs:element>
+      <xs:element minOccurs="0" name="arg1" type="tns:operands"></xs:element>
     </xs:sequence>
   </xs:complexType>
 
@@ -92,6 +129,18 @@
     </xs:sequence>
   </xs:complexType>
 
+  <xs:complexType name="addNumberAndOperandsResponse">
+    <xs:sequence>
+      <xs:element name="return" type="xs:int"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="addOperands">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="arg0" type="tns:operands"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
+
   <xs:complexType name="addOperandsResponse">
     <xs:sequence>
       <xs:element minOccurs="0" name="return" type="tns:result"></xs:element>
@@ -120,6 +169,42 @@
 
 </xs:schema>
   </wsdl:types>
+  <wsdl:message name="addListResponse">
+    <wsdl:part element="tns:addListResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addArray">
+    <wsdl:part element="tns:addArray" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="divide">
+    <wsdl:part element="tns:divide" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addList">
+    <wsdl:part element="tns:addList" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addOperandsResponse">
+    <wsdl:part element="tns:addOperandsResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addNumberAndOperands">
+    <wsdl:part element="tns:addNumberAndOperands" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addNumberAndOperandsResponse">
+    <wsdl:part element="tns:addNumberAndOperandsResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="addOperands">
+    <wsdl:part element="tns:addOperands" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="multiply">
+    <wsdl:part element="tns:multiply" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="add">
     <wsdl:part element="tns:add" name="parameters">
     </wsdl:part>
@@ -144,41 +229,47 @@
     <wsdl:part element="tns:divideResponse" name="parameters">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="divide">
-    <wsdl:part element="tns:divide" name="parameters">
-    </wsdl:part>
-  </wsdl:message>
-  <wsdl:message name="addOperandsResponse">
-    <wsdl:part element="tns:addOperandsResponse" name="parameters">
-    </wsdl:part>
-  </wsdl:message>
-  <wsdl:message name="addOperands">
-    <wsdl:part element="tns:addOperands" name="parameters">
-    </wsdl:part>
-  </wsdl:message>
-  <wsdl:message name="multiply">
-    <wsdl:part element="tns:multiply" name="parameters">
+  <wsdl:message name="addArrayResponse">
+    <wsdl:part element="tns:addArrayResponse" name="parameters">
     </wsdl:part>
   </wsdl:message>
   <wsdl:portType name="CalculatorService">
-    <wsdl:operation name="divide">
-      <wsdl:input message="tns:divide" name="divide">
-    </wsdl:input>
-      <wsdl:output message="tns:divideResponse" name="divideResponse">
-    </wsdl:output>
-    </wsdl:operation>
     <wsdl:operation name="add">
       <wsdl:input message="tns:add" name="add">
     </wsdl:input>
       <wsdl:output message="tns:addResponse" name="addResponse">
     </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="addArray">
+      <wsdl:input message="tns:addArray" name="addArray">
+    </wsdl:input>
+      <wsdl:output message="tns:addArrayResponse" name="addArrayResponse">
+    </wsdl:output>
+    </wsdl:operation>
     <wsdl:operation name="subtract">
       <wsdl:input message="tns:subtract" name="subtract">
     </wsdl:input>
       <wsdl:output message="tns:subtractResponse" name="subtractResponse">
     </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="divide">
+      <wsdl:input message="tns:divide" name="divide">
+    </wsdl:input>
+      <wsdl:output message="tns:divideResponse" name="divideResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="addList">
+      <wsdl:input message="tns:addList" name="addList">
+    </wsdl:input>
+      <wsdl:output message="tns:addListResponse" name="addListResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="addNumberAndOperands">
+      <wsdl:input message="tns:addNumberAndOperands" name="addNumberAndOperands">
+    </wsdl:input>
+      <wsdl:output message="tns:addNumberAndOperandsResponse" name="addNumberAndOperandsResponse">
+    </wsdl:output>
+    </wsdl:operation>
     <wsdl:operation name="addOperands">
       <wsdl:input message="tns:addOperands" name="addOperands">
     </wsdl:input>
@@ -194,21 +285,21 @@
   </wsdl:portType>
   <wsdl:binding name="CalculatorServiceSoapBinding" type="tns:CalculatorService">
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
-    <wsdl:operation name="divide">
+    <wsdl:operation name="add">
       <soap:operation soapAction="" style="document"></soap:operation>
-      <wsdl:input name="divide">
+      <wsdl:input name="add">
         <soap:body use="literal"></soap:body>
       </wsdl:input>
-      <wsdl:output name="divideResponse">
+      <wsdl:output name="addResponse">
         <soap:body use="literal"></soap:body>
       </wsdl:output>
     </wsdl:operation>
-    <wsdl:operation name="add">
+    <wsdl:operation name="addArray">
       <soap:operation soapAction="" style="document"></soap:operation>
-      <wsdl:input name="add">
+      <wsdl:input name="addArray">
         <soap:body use="literal"></soap:body>
       </wsdl:input>
-      <wsdl:output name="addResponse">
+      <wsdl:output name="addArrayResponse">
         <soap:body use="literal"></soap:body>
       </wsdl:output>
     </wsdl:operation>
@@ -221,6 +312,33 @@
         <soap:body use="literal"></soap:body>
       </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="divide">
+      <soap:operation soapAction="" style="document"></soap:operation>
+      <wsdl:input name="divide">
+        <soap:body use="literal"></soap:body>
+      </wsdl:input>
+      <wsdl:output name="divideResponse">
+        <soap:body use="literal"></soap:body>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="addList">
+      <soap:operation soapAction="" style="document"></soap:operation>
+      <wsdl:input name="addList">
+        <soap:body use="literal"></soap:body>
+      </wsdl:input>
+      <wsdl:output name="addListResponse">
+        <soap:body use="literal"></soap:body>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="addNumberAndOperands">
+      <soap:operation soapAction="" style="document"></soap:operation>
+      <wsdl:input name="addNumberAndOperands">
+        <soap:body use="literal"></soap:body>
+      </wsdl:input>
+      <wsdl:output name="addNumberAndOperandsResponse">
+        <soap:body use="literal"></soap:body>
+      </wsdl:output>
+    </wsdl:operation>
     <wsdl:operation name="addOperands">
       <soap:operation soapAction="" style="document"></soap:operation>
       <wsdl:input name="addOperands">
@@ -242,7 +360,7 @@
   </wsdl:binding>
   <wsdl:service name="CalculatorService">
     <wsdl:port binding="tns:CalculatorServiceSoapBinding" name="Calculator">
-      <soap:address location="http://172.17.0.4:8080/calculator-ws/CalculatorService"></soap:address>
+      <soap:address location="http://172.17.0.3:8080/calculator-ws/CalculatorService"></soap:address>
     </wsdl:port>
   </wsdl:service>
 </wsdl:definitions>
\ No newline at end of file
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
index d12d2c30ca..d8ff5eba2c 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfClientTestResource.java
@@ -36,7 +36,7 @@ public class CxfClientTestResource implements QuarkusTestResourceLifecycleManage
     public Map<String, String> start() {
 
         try {
-            calculatorContainer = new GenericContainer<>("quay.io/l2x6/calculator-ws:1.0")
+            calculatorContainer = new GenericContainer<>("quay.io/l2x6/calculator-ws:1.1")
                     .withExposedPorts(WILDFLY_PORT)
                     .withLogConsumer(new Slf4jLogConsumer(log))
                     .waitingFor(Wait.forHttp("/calculator-ws/CalculatorService?wsdl"));
diff --git a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
index 236c35295f..ad9d1cb0e4 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/client/it/CxfSoapClientTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.quarkus.component.cxf.soap.client.it;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -30,6 +29,7 @@ import org.eclipse.microprofile.config.ConfigProvider;
 import org.hamcrest.CoreMatchers;
 import org.hamcrest.Matchers;
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
@@ -48,6 +48,7 @@ class CxfSoapClientTest {
                 .queryParam("a", "9")
                 .queryParam("b", "3")
                 .queryParam("endpointUri", endpointUri)
+                .queryParam("operation", "divide")
                 .post("/cxf-soap/client/simple")
                 .then()
                 .statusCode(201)
@@ -91,16 +92,9 @@ class CxfSoapClientTest {
                 .getValue("camel-quarkus.it.calculator.baseUri", String.class);
 
         final String wsdlRelPath = "wsdl/CalculatorService.wsdl";
-        final Path staticCopyPath = Paths.get("target/classes/" + wsdlRelPath);
-        if (!Files.isRegularFile(staticCopyPath)) {
-            /* The test is run inside Quarkus Platform
-             * and the resource is not available in the filesystem
-             * So let's copy it */
-            Files.createDirectories(staticCopyPath.getParent());
-            try (InputStream in = getClass().getClassLoader().getResourceAsStream(wsdlRelPath)) {
-                Files.copy(in, staticCopyPath);
-            }
-        }
+        final Path staticCopyPath = Paths.get("src/main/resources/" + wsdlRelPath);
+        Assumptions.assumeTrue(Files.isRegularFile(staticCopyPath),
+                staticCopyPath + " does not exist - we probably run inside Quarkus Platform");
 
         /* The changing Docker IP address in the WSDL should not matter */
         final String sanitizerRegex = "<soap:address location=\"http://[^/]*/calculator-ws/CalculatorService\"></soap:address>";
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java b/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java
index ca35e586f8..24f0d3ced6 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.quarkus.component.cxf.soap.wss.client.it;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -28,6 +27,7 @@ import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import org.eclipse.microprofile.config.ConfigProvider;
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.Matchers.equalTo;
@@ -59,16 +59,10 @@ class CxfSoapWssClientTest {
                 .getValue("camel-quarkus.it.wss.client.baseUri", String.class);
 
         final String wsdlRelPath = "wsdl/WssCalculatorService.wsdl";
-        final Path staticCopyPath = Paths.get("target/classes/" + wsdlRelPath);
-        if (!Files.isRegularFile(staticCopyPath)) {
-            /* The test is run inside Quarkus Platform
-             * and the resource is not available in the filesystem
-             * So let's copy it */
-            Files.createDirectories(staticCopyPath.getParent());
-            try (InputStream in = getClass().getClassLoader().getResourceAsStream(wsdlRelPath)) {
-                Files.copy(in, staticCopyPath);
-            }
-        }
+        final Path staticCopyPath = Paths.get("src/main/resources/" + wsdlRelPath);
+        Assumptions.assumeTrue(Files.isRegularFile(staticCopyPath),
+                staticCopyPath + " does not exist - we probably run inside Quarkus Platform");
+
         /* The changing Docker IP address in the WSDL should not matter */
         final String sanitizerRegex = "<soap:address location=\"http://[^/]*/calculator-ws/WssCalculatorService\"></soap:address>";
         final String staticCopyContent = Files
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfWssClientTestResource.java b/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfWssClientTestResource.java
index 94412b124d..3e70613e19 100644
--- a/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfWssClientTestResource.java
+++ b/integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfWssClientTestResource.java
@@ -40,7 +40,7 @@ public class CxfWssClientTestResource implements QuarkusTestResourceLifecycleMan
 
         try {
             try {
-                calculatorContainer = new GenericContainer<>("quay.io/l2x6/calculator-ws:1.0")
+                calculatorContainer = new GenericContainer<>("quay.io/l2x6/calculator-ws:1.1")
                         .withEnv("WSS_USER", user)
                         .withEnv("WSS_PASSWORD", password)
                         .withLogConsumer(new Slf4jLogConsumer(log))


[camel-quarkus] 06/06: Cxf-soap: Extend test coverage with Ssl scenario #4679

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 9373d7615ca0ba6c2e1a53b49cf5ed38f8827194
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Tue Mar 21 14:10:10 2023 +0100

    Cxf-soap: Extend test coverage with Ssl scenario #4679
---
 .../cxf-soap/cxf-soap-ssl/pom.xml                  | 236 ++++++++++++++++
 .../cxf/soap/ssl/it/CxfSoapSslResource.java        |  84 ++++++
 .../cxf/soap/ssl/it/CxfSoapSslRoutes.java          | 210 ++++++++++++++
 .../component/cxf/soap/ssl/it/GreeterImpl.java     |  24 ++
 .../component/cxf/soap/ssl/it/GreeterService.java  |  27 ++
 .../src/main/resources/application.properties      |  23 ++
 .../cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java |  23 ++
 .../soap/ssl/it/CxfSoapGlobalTrustedSslTest.java   |  43 +++
 .../soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java   |  23 ++
 .../soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java |  43 +++
 .../component/cxf/soap/ssl/it/CxfSoapSslIT.java    |  23 ++
 .../component/cxf/soap/ssl/it/CxfSoapSslTest.java  |  65 +++++
 integration-test-groups/cxf-soap/pom.xml           |   1 +
 integration-tests/cxf-soap-grouped/pom.xml         | 302 +++++++++++++++++++++
 14 files changed, 1127 insertions(+)

diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/pom.xml b/integration-test-groups/cxf-soap/cxf-soap-ssl/pom.xml
new file mode 100644
index 0000000000..cf690898f5
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/pom.xml
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-build-parent-it</artifactId>
+        <version>2.13.3-SNAPSHOT</version>
+        <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-cxf-soap-ssl</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Cxf Soap Ssl</name>
+    <description>Integration tests for Camel Quarkus CXF extension ssl part</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-cxf-soap</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.rest-assured</groupId>
+            <artifactId>rest-assured</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkiverse.cxf</groupId>
+            <artifactId>quarkus-cxf-test-util</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>${quarkus.platform.group-id}</groupId>
+                <artifactId>quarkus-maven-plugin</artifactId>
+                <version>${quarkus.platform.version}</version>
+                <extensions>true</extensions><!-- Workaround for https://github.com/quarkusio/quarkus/issues/21718 -->
+                <executions>
+                    <execution>
+                        <id>generate-code</id>
+                        <goals>
+                            <goal>generate-code</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.package.type>native</quarkus.package.type>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>full</id>
+            <activation>
+                <property>
+                    <name>!quickly</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>keytool-maven-plugin</artifactId>
+                        <configuration>
+                            <keypass>password</keypass>
+                            <validity>365</validity>
+                            <keyalg>RSA</keyalg>
+                            <storepass>password</storepass>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>generate-server-keypair</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <dname>CN=localhost, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>bc:c=ca:true,pathlen:2147483647</ext>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/truststore-server.jks</keystore>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>export-server-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exportCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <keystore>${project.build.outputDirectory}/truststore-server.jks</keystore>
+                                    <rfc>true</rfc>
+                                    <file>${project.build.outputDirectory}/localhost.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>create-client-trusstore</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/truststore-client.jks</keystore>
+                                    <file>${project.build.outputDirectory}/localhost.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-wrong-trusstore</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <dname>CN=localhost, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>bc:c=ca:true,pathlen:2147483647</ext>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/truststore-wrong.jks</keystore>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>virtualDependencies</id>
+            <activation>
+                <property>
+                    <name>!noVirtualDependencies</name>
+                </property>
+            </activation>
+            <dependencies>
+                <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-cxf-soap-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-direct-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+</project>
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslResource.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslResource.java
new file mode 100644
index 0000000000..41aaa270bb
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslResource.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import java.net.URI;
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+
+@Path("/cxf-soap/ssl")
+@ApplicationScoped
+public class CxfSoapSslResource {
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/trusted/{global}")
+    @POST
+    @Consumes(MediaType.WILDCARD)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response trusted(@PathParam("global") String global, String msg) throws Exception {
+        return invoke("true", String.valueOf(global), msg);
+    }
+
+    @Path("/untrusted/{global}")
+    @POST
+    @Consumes(MediaType.WILDCARD)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response untrusted(@PathParam("global") String global, String msg) throws Exception {
+        return invoke("false", String.valueOf(global), msg);
+    }
+
+    @Path("/notrust")
+    @POST
+    @Consumes(MediaType.WILDCARD)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response notrust(String msg) throws Exception {
+        return invoke("notrust", "", msg);
+    }
+
+    private Response invoke(String trust, String global, String msg) throws Exception {
+        String response;
+        try {
+            response = producerTemplate.requestBodyAndHeaders("direct:sslInvoker", msg,
+                    Map.of("global", global, "trust", trust),
+                    String.class);
+        } catch (Exception e) {
+            return Response
+                    .created(new URI("https://camel.apache.org/"))
+                    .entity(e.getCause().getCause().getMessage())
+                    .status(500)
+                    .build();
+        }
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslRoutes.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslRoutes.java
new file mode 100644
index 0000000000..e45dcf5ed8
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslRoutes.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import io.quarkus.runtime.LaunchMode;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Processor;
+import org.apache.camel.SSLContextParametersAware;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
+import org.apache.camel.support.jsse.KeyStoreParameters;
+import org.apache.camel.support.jsse.SSLContextParameters;
+import org.apache.camel.support.jsse.TrustManagersParameters;
+import org.apache.cxf.ext.logging.LoggingFeature;
+import org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier;
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+
+@ApplicationScoped
+public class CxfSoapSslRoutes extends RouteBuilder {
+
+    @Inject
+    @Named("loggingFeatureSsl")
+    LoggingFeature loggingFeature;
+
+    @Inject
+    CamelContext camelContext;
+
+    @Inject
+    @Named("rightSslContext")
+    SSLContextParameters correctSslContext;
+
+    @Inject
+    @Named("wrongSslContext")
+    SSLContextParameters wrongSslContext;
+
+    @Override
+    public void configure() {
+
+        from("direct:sslInvoker")
+                .process(exchange -> {
+                    Map<String, Object> headers = exchange.getIn().getHeaders();
+                    headers.put("address", getServerUrl() + "/soapservice/Ssl/RouterPort");
+
+                    String global = exchange.getIn().getHeader("global", String.class);
+                    String trust = exchange.getIn().getHeader("trust", String.class);
+
+                    if ("notrust".equals(trust)) {
+                        camelContext.setSSLContextParameters(null);
+                        //router endpoint does not contain ssl configuration, therefore can be used for notrust test case
+                        headers.put("endpoint", "soapSslRouter");
+                    } else if ("true".equals(global)) {
+                        camelContext.setSSLContextParameters("true".equals(trust) ? correctSslContext : wrongSslContext);
+                        headers.put("endpoint", "soapSslGlobal");
+                    } else {
+                        camelContext.setSSLContextParameters(null);
+                        headers.put("endpoint", "soapSslLocal" + ("true".equals(trust) ? "Correct" : "Wrong"));
+                    }
+                    ((SSLContextParametersAware) camelContext.getComponent("cxf"))
+                            .setUseGlobalSslContextParameters(Boolean.parseBoolean(global));
+                })
+                .toD("cxf:bean:${header.endpoint}?address=${header.address}");
+
+        from("cxf:bean:soapSslRouter")
+                .process("responseProcessor");
+
+    }
+
+    @Produces
+    @SessionScoped
+    @Named("soapSslLocalCorrect")
+    CxfEndpoint soapSslLocalCorrect(DefaultHostnameVerifier defaultHostnameVerifier) {
+        final CxfEndpoint result = new CxfEndpoint();
+        result.getFeatures().add(loggingFeature);
+        result.setServiceClass(GreeterService.class);
+        result.setAddress("/Ssl/RouterPort");
+        result.setSslContextParameters(correctSslContext);
+        result.setHostnameVerifier(defaultHostnameVerifier);
+        return result;
+    }
+
+    @Produces
+    @SessionScoped
+    @Named("soapSslLocalWrong")
+    CxfEndpoint soapSslLocalWrong(DefaultHostnameVerifier defaultHostnameVerifier) {
+        final CxfEndpoint result = new CxfEndpoint();
+        result.getFeatures().add(loggingFeature);
+        result.setServiceClass(GreeterService.class);
+        result.setAddress("/Ssl/RouterPort");
+        result.setSslContextParameters(wrongSslContext);
+        result.setHostnameVerifier(defaultHostnameVerifier);
+        return result;
+    }
+
+    @Produces
+    @SessionScoped
+    @Named("soapSslGlobal")
+    CxfEndpoint soapSslGlobal() {
+        final CxfEndpoint result = new CxfEndpoint();
+        result.getFeatures().add(loggingFeature);
+        result.setServiceClass(GreeterService.class);
+        result.setAddress("/Ssl/RouterPort");
+        return result;
+    }
+
+    @Produces
+    @SessionScoped
+    @Named("soapSslRouter")
+    CxfEndpoint soapSslRouter() {
+        final CxfEndpoint result = new CxfEndpoint();
+        result.getFeatures().add(loggingFeature);
+        result.setServiceClass(GreeterService.class);
+        result.setAddress("/Ssl/RouterPort");
+        return result;
+    }
+
+    @Produces
+    @SessionScoped
+    @Named
+    GreeterService greeterService() {
+        return new GreeterImpl();
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Named("loggingFeatureSsl")
+    public LoggingFeature loggingFeature() {
+        final LoggingFeature result = new LoggingFeature();
+        result.setPrettyLogging(true);
+        return result;
+    }
+
+    @ApplicationScoped
+    @Named("responseProcessor")
+    Processor responseProcessor(GreeterService greeterService) {
+
+        return exchange -> {
+            String resp = greeterService.greetMe(exchange.getIn().getBody(String.class));
+            exchange.getIn().setBody(resp);
+        };
+    }
+
+    private static String getServerUrl() {
+        Config config = ConfigProvider.getConfig();
+        final int port = LaunchMode.current().equals(LaunchMode.TEST)
+                ? config.getValue("quarkus.http.test-ssl-port", Integer.class)
+                : config.getValue("quarkus.http.ssl-port", Integer.class);
+        return String.format("https://localhost:%d", port);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Named("rightSslContext")
+    SSLContextParameters rightSslContext() {
+        SSLContextParameters sslContext = new SSLContextParameters();
+        TrustManagersParameters trustManager = new TrustManagersParameters();
+        KeyStoreParameters keyStore = new KeyStoreParameters();
+        keyStore.setType("PKCS12");
+        keyStore.setPassword("password");
+        keyStore.setResource("truststore-client.jks");
+        trustManager.setKeyStore(keyStore);
+        sslContext.setTrustManagers(trustManager);
+        return sslContext;
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Named("wrongSslContext")
+    SSLContextParameters wrongSslContext() {
+        SSLContextParameters sslContext = new SSLContextParameters();
+        TrustManagersParameters trustManager = new TrustManagersParameters();
+        KeyStoreParameters keyStore = new KeyStoreParameters();
+        keyStore.setType("PKCS12");
+        keyStore.setPassword("password");
+        keyStore.setResource("truststore-wrong.jks");
+        trustManager.setKeyStore(keyStore);
+        sslContext.setTrustManagers(trustManager);
+        return sslContext;
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Named("defaultHostnameVerifier")
+    DefaultHostnameVerifier defaultHostnameVerifier() {
+        return new DefaultHostnameVerifier();
+    }
+
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterImpl.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterImpl.java
new file mode 100644
index 0000000000..9ac037bb75
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterImpl.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+public class GreeterImpl implements GreeterService {
+    @Override
+    public String greetMe(String name) {
+        return "Hello " + name + "!";
+    }
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterService.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterService.java
new file mode 100644
index 0000000000..a6f595bec1
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/GreeterService.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+public interface GreeterService {
+
+    @WebMethod
+    String greetMe(String name);
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/resources/application.properties b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/resources/application.properties
new file mode 100644
index 0000000000..936c13706f
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/main/resources/application.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+quarkus.cxf.path=/soapservice
+quarkus.native.resources.includes=truststore-client.jks,truststore-server.jks,truststore-wrong.jks
+
+quarkus.http.ssl.certificate.key-store-file-type=PKCS12
+quarkus.http.ssl.certificate.key-store-file=truststore-server.jks
+quarkus.http.ssl.certificate.key-store-password=password
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java
new file mode 100644
index 0000000000..d3642b9d3b
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslIT.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class CxfSoapGlobalTrustedSslIT extends CxfSoapGlobalTrustedSslTest {
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslTest.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslTest.java
new file mode 100644
index 0000000000..8fccffa4be
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalTrustedSslTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.equalTo;
+
+@QuarkusTest
+@TestProfile(CxfSoapGlobalTrustedSslTest.class)
+public class CxfSoapGlobalTrustedSslTest implements QuarkusTestProfile {
+
+    // Test is ported from SslTest in Camel-spring-boot/components-starter/camel-cxf-soap-starter
+    // Test requires restart of Quarkus to avoid persisting of globalssl context.
+    @Test
+    public void testInvokingTrustedRoute() {
+        RestAssured.given()
+                .body("ssl")
+                .post("/cxf-soap/ssl/trusted/global")
+                .then()
+                .statusCode(201)
+                .body(equalTo("Hello ssl!"));
+    }
+
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java
new file mode 100644
index 0000000000..821865c669
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslIT.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class CxfSoapGlobalUntrustedSslIT extends CxfSoapGlobalUntrustedSslTest {
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java
new file mode 100644
index 0000000000..d19ba9aaaa
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapGlobalUntrustedSslTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.containsString;
+
+@QuarkusTest
+@TestProfile(CxfSoapGlobalUntrustedSslTest.class)
+public class CxfSoapGlobalUntrustedSslTest implements QuarkusTestProfile {
+
+    // Test is ported from SslTest in Camel-spring-boot/components-starter/camel-cxf-soap-starter
+    // Test requires restart of Quarkus to avoid persisting of global ssl context.
+    @Test
+    public void testInvokingUntrustedRoute() {
+        RestAssured.given()
+                .body("ssl")
+                .post("/cxf-soap/ssl/untrusted/global")
+                .then()
+                .statusCode(500)
+                .body(containsString("signature check failed"));
+    }
+
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslIT.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslIT.java
new file mode 100644
index 0000000000..b8b5fc9bf1
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslIT.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+class CxfSoapSslIT extends CxfSoapSslTest {
+}
diff --git a/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslTest.java b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslTest.java
new file mode 100644
index 0000000000..9e632978c5
--- /dev/null
+++ b/integration-test-groups/cxf-soap/cxf-soap-ssl/src/test/java/org/apache/camel/quarkus/component/cxf/soap/ssl/it/CxfSoapSslTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.cxf.soap.ssl.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.equalTo;
+
+// Tests require restart of Quarkus to avoid persisting of global ssl context.
+@QuarkusTest
+@TestProfile(CxfSoapSslTest.class)
+public class CxfSoapSslTest implements QuarkusTestProfile {
+
+    // Test is ported from SslTest in Camel-spring-boot/components-starter/camel-cxf-soap-starter
+    @Test
+    public void testInvokingTrustedRoute() {
+        RestAssured.given()
+                .body("ssl")
+                .post("/cxf-soap/ssl/trusted/local")
+                .then()
+                .statusCode(201)
+                .body(equalTo("Hello ssl!"));
+    }
+
+    // Test is ported from SslTest in Camel-spring-boot/components-starter/camel-cxf-soap-starter
+    @Test
+    public void testInvokingUntrustedRoute() {
+        RestAssured.given()
+                .body("ssl")
+                .post("/cxf-soap/ssl/untrusted/local")
+                .then()
+                .statusCode(500)
+                .body(containsString("signature check failed"));
+    }
+
+    // Test is ported from SslTest in Camel-spring-boot/components-starter/camel-cxf-soap-starter
+    @Test
+    public void testInvokingNotrustRoute() {
+        RestAssured.given()
+                .body("ssl")
+                .post("/cxf-soap/ssl/notrust")
+                .then()
+                .statusCode(500)
+                .body(containsString("unable to find valid certification path to requested target"));
+    }
+}
diff --git a/integration-test-groups/cxf-soap/pom.xml b/integration-test-groups/cxf-soap/pom.xml
index 527f12c48e..eab1e401da 100644
--- a/integration-test-groups/cxf-soap/pom.xml
+++ b/integration-test-groups/cxf-soap/pom.xml
@@ -41,6 +41,7 @@
         <module>cxf-soap-mtom</module>
         <module>cxf-soap-mtom-awt</module>
         <module>cxf-soap-server</module>
+        <module>cxf-soap-ssl</module>
         <module>cxf-soap-ws-security-client</module>
         <module>cxf-soap-ws-security-server</module>
         <module>cxf-soap-ws-trust</module>
diff --git a/integration-tests/cxf-soap-grouped/pom.xml b/integration-tests/cxf-soap-grouped/pom.xml
index 868f1107dc..6eac44d9de 100644
--- a/integration-tests/cxf-soap-grouped/pom.xml
+++ b/integration-tests/cxf-soap-grouped/pom.xml
@@ -403,6 +403,10 @@
                                     <wsdl>${basedir}/target/classes/wsdl/CalculatorService.wsdl</wsdl>
                                     <wsdlLocation>classpath:wsdl/CalculatorService.wsdl</wsdlLocation>
                                 </wsdlOption>
+                                <wsdlOption>
+                                    <wsdl>${basedir}/target/classes/wsdl/BasicAuthCalculatorService.wsdl</wsdl>
+                                    <wsdlLocation>classpath:wsdl/BasicAuthCalculatorService.wsdl</wsdlLocation>
+                                </wsdlOption>
                                 <wsdlOption>
                                     <wsdl>${basedir}/target/classes/wsdl/HelloService.wsdl</wsdl>
                                     <wsdlLocation>classpath:wsdl/HelloService.wsdl</wsdlLocation>
@@ -504,6 +508,304 @@
                 </dependency>
             </dependencies>
         </profile>
+        <profile>
+            <id>full</id>
+            <activation>
+                <property>
+                    <name>!quickly</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>keytool-maven-plugin</artifactId>
+                        <configuration>
+                            <keypass>password</keypass>
+                            <validity>365</validity>
+                            <keyalg>RSA</keyalg>
+                            <storepass>password</storepass>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>generate-cxfca-keypair</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <dname>CN=cxfca, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>bc:c=ca:true,pathlen:2147483647</ext>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/cxfca.jks</keystore>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>export-cxfca-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exportCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <keystore>${project.build.outputDirectory}/cxfca.jks</keystore>
+                                    <rfc>true</rfc>
+                                    <file>${project.build.outputDirectory}/cxfca.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-alice-keypair</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>alice</alias>
+                                    <dname>CN=alice, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                        <ext>SubjectAlternativeName=DNS:localhost,IP:127.0.0.1</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/alice.jks</keystore>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-bob-keypair</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>bob</alias>
+                                    <dname>CN=bob, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                        <ext>SubjectAlternativeName=DNS:localhost,IP:127.0.0.1</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/bob.jks</keystore>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-alice-certificate-request</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generateCertificateRequest</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>alice</alias>
+                                    <keystore>${project.build.outputDirectory}/alice.jks</keystore>
+                                    <file>${project.build.outputDirectory}/alice.csr</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-alice-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generateCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <keystore>${project.build.outputDirectory}/cxfca.jks</keystore>
+                                    <rfc>true</rfc>
+                                    <infile>${project.build.outputDirectory}/alice.csr</infile>
+                                    <outfile>${project.build.outputDirectory}/alice.pem</outfile>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-bob-certificate-request</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generateCertificateRequest</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>bob</alias>
+                                    <keystore>${project.build.outputDirectory}/bob.jks</keystore>
+                                    <file>${project.build.outputDirectory}/bob.csr</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-bob-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generateCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <keystore>${project.build.outputDirectory}/cxfca.jks</keystore>
+                                    <rfc>true</rfc>
+                                    <infile>${project.build.outputDirectory}/bob.csr</infile>
+                                    <outfile>${project.build.outputDirectory}/bob.pem</outfile>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-cxfca-certificate-to-alice</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/alice.jks</keystore>
+                                    <file>${project.build.outputDirectory}/cxfca.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-cxfca-certificate-to-bob</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>cxfca</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/bob.jks</keystore>
+                                    <file>${project.build.outputDirectory}/cxfca.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-alice-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>alice</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/alice.jks</keystore>
+                                    <file>${project.build.outputDirectory}/alice.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-bob-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>bob</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/bob.jks</keystore>
+                                    <file>${project.build.outputDirectory}/bob.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-bob-certificate-to-alice</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>bob</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/alice.jks</keystore>
+                                    <file>${project.build.outputDirectory}/bob.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>import-alice-certificate-to-bob</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>alice</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/bob.jks</keystore>
+                                    <file>${project.build.outputDirectory}/alice.pem</file>
+                                </configuration>
+                            </execution>
+        <!--                Uncomment execution block below for local testing -->
+        <!--                    <execution>-->
+        <!--                        <id>list</id>-->
+        <!--                        <phase>generate-sources</phase>-->
+        <!--                        <goals>-->
+        <!--                            <goal>list</goal>-->
+        <!--                        </goals>-->
+        <!--                        <configuration>-->
+        <!--                            <verbose>true</verbose>-->
+        <!--                            <keystore>${project.build.outputDirectory}/bob.jks</keystore>-->
+        <!--                        </configuration>-->
+        <!--                    </execution>-->
+                            <execution>
+                                <id>generate-server-keypair</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <dname>CN=localhost, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>bc:c=ca:true,pathlen:2147483647</ext>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/truststore-server.jks</keystore>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>export-server-certificate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exportCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <keystore>${project.build.outputDirectory}/truststore-server.jks</keystore>
+                                    <rfc>true</rfc>
+                                    <file>${project.build.outputDirectory}/localhost.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>create-client-trusstore</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>importCertificate</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <trustcacerts>true</trustcacerts>
+                                    <noprompt>true</noprompt>
+                                    <keystore>${project.build.outputDirectory}/truststore-client.jks</keystore>
+                                    <file>${project.build.outputDirectory}/localhost.pem</file>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-wrong-trusstore</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                    <goal>generateKeyPair</goal>
+                                </goals>
+                                <configuration>
+                                    <alias>localhost</alias>
+                                    <dname>CN=localhost, OU=eng, O=apache.org</dname>
+                                    <exts>
+                                        <ext>bc:c=ca:true,pathlen:2147483647</ext>
+                                        <ext>IssuerAlternativeName=DNS:NOT-FOR-PRODUCTION-USE</ext>
+                                    </exts>
+                                    <keystore>${project.build.outputDirectory}/truststore-wrong.jks</keystore>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>skip-testcontainers-tests</id>
             <activation>


[camel-quarkus] 01/06: Ref #4596: Expand JDBC tests - named parameters and samples (#4655)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit ad9c3b1f255c7e2acd214b29fb5f5ab800c60a6c
Author: Lucia Drozdová <89...@users.noreply.github.com>
AuthorDate: Fri Mar 24 14:27:02 2023 +0100

    Ref #4596: Expand JDBC tests - named parameters and samples (#4655)
    
    * Ref #4596: Expand JDBC tests - named parameters and samples
    
    * Fix imports
---
 integration-tests/jdbc/pom.xml                     |  80 ++++++++++++++-
 .../quarkus/component/jdbc/CamelResource.java      |  78 ++++++++++++++-
 .../camel/quarkus/component/jdbc/JdbcRoutes.java   |  67 +++++++++++++
 .../quarkus/component/jdbc/CamelJdbcTest.java      | 111 +++++++++++++++++++++
 4 files changed, 333 insertions(+), 3 deletions(-)

diff --git a/integration-tests/jdbc/pom.xml b/integration-tests/jdbc/pom.xml
index 11f753b626..c9fc80fb88 100644
--- a/integration-tests/jdbc/pom.xml
+++ b/integration-tests/jdbc/pom.xml
@@ -17,7 +17,8 @@
     limitations under the License.
 
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
@@ -39,6 +40,14 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-log</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-timer</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-bean</artifactId>
+        </dependency>
         <dependency>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-resteasy</artifactId>
@@ -47,6 +56,18 @@
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-jdbc-h2</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-jsonb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-mock</artifactId>
+        </dependency>
 
         <!-- test dependencies -->
         <dependency>
@@ -64,6 +85,11 @@
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 
@@ -104,6 +130,19 @@
             </activation>
             <dependencies>
                 <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-direct-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-jdbc-deployment</artifactId>
@@ -130,6 +169,45 @@
                         </exclusion>
                     </exclusions>
                 </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-mock-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-timer-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-bean-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
             </dependencies>
         </profile>
     </profiles>
diff --git a/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/CamelResource.java b/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/CamelResource.java
index 90312e8767..6bdc09f67f 100644
--- a/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/CamelResource.java
+++ b/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/CamelResource.java
@@ -17,10 +17,11 @@
 package org.apache.camel.quarkus.component.jdbc;
 
 import java.sql.Connection;
-import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -35,7 +36,9 @@ import javax.ws.rs.core.MediaType;
 
 import io.agroal.api.AgroalDataSource;
 import io.quarkus.agroal.DataSource;
+import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.quarkus.component.jdbc.model.Camel;
 
 @Path("/test")
@@ -48,18 +51,27 @@ public class CamelResource {
     @Inject
     ProducerTemplate template;
 
+    @Inject
+    CamelContext context;
+
     @PostConstruct
-    void postConstruct() throws SQLException {
+    void postConstruct() throws Exception {
         try (Connection con = dataSource.getConnection()) {
             try (Statement statement = con.createStatement()) {
                 try {
                     statement.execute("drop table camels");
+                    statement.execute("drop table camelsGenerated");
                 } catch (Exception ignored) {
                 }
                 statement.execute("create table camels (id int primary key, species varchar(255))");
+                statement.execute("create table camelsGenerated (id int primary key auto_increment, species varchar(255))");
+                statement.execute("create table camelsProcessed (id int primary key auto_increment, species varchar(255))");
+                statement.execute("insert into camelsGenerated (species) values ('Camelus status'), ('Camelus linus')");
                 statement.execute("insert into camels (id, species) values (1, 'Camelus dromedarius')");
                 statement.execute("insert into camels (id, species) values (2, 'Camelus bactrianus')");
                 statement.execute("insert into camels (id, species) values (3, 'Camelus ferus')");
+
+                context.getRouteController().startRoute("jdbc-poll");
             }
         }
     }
@@ -110,4 +122,66 @@ public class CamelResource {
     public String executeStatement(String statement) throws Exception {
         return template.requestBody("jdbc:camel-ds", statement, String.class);
     }
+
+    @Path("/generated-keys/rows")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public List generatedKeysRows() throws Exception {
+        return template.requestBodyAndHeader("direct://get-generated-keys",
+                "insert into camelsGenerated (species) values ('Camelus testus'), ('Camelus legendarius')",
+                "CamelRetrieveGeneratedKeys", "true", ArrayList.class);
+    }
+
+    @Path("/headers/insert")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public String headersFromInsertOrUpdate() throws Exception {
+        return template.requestBodyAndHeader("direct://get-headers",
+                "insert into camelsGenerated (species) values ('Camelus status'), ('Camelus linus')",
+                "CamelRetrieveGeneratedKeys", "true", String.class);
+    }
+
+    @Path("/headers/select")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public String headersFromSelect() throws Exception {
+        return template.requestBody("direct://get-headers", "select * from camelsGenerated", String.class);
+    }
+
+    @Path("/named-parameters/headers-as-parameters")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public String headersAsParameters() throws Exception {
+        return template.requestBodyAndHeader("direct://headers-as-parameters",
+                "select * from camels where id < :?idmax order by id",
+                "idmax", "3", String.class);
+    }
+
+    @Path("/named-parameters/headers-as-parameters-map")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public String headersAsParametersMap() throws Exception {
+        Map<String, String> headersMap = Map.of("idmax", "3", "specs", "Camelus bactrianus");
+        return template.requestBodyAndHeader("direct://headers-as-parameters",
+                "select * from camels where id < :?idmax and species = :?specs order by id",
+                "CamelJdbcParameters", headersMap, String.class);
+    }
+
+    @Path("/interval-polling")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public void intervalPolling(String selectResult) throws Exception {
+        MockEndpoint mockEndpoint = context.getEndpoint("mock:interval-polling", MockEndpoint.class);
+        mockEndpoint.expectedBodiesReceived(selectResult);
+
+        mockEndpoint.assertIsSatisfied();
+    }
+
+    @Path("/move-between-datasources")
+    @POST
+    @Produces(MediaType.APPLICATION_JSON)
+    public String moveBetweenDatasources() throws Exception {
+        return template.requestBody("direct://move-between-datasources", null, String.class);
+    }
+
 }
diff --git a/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/JdbcRoutes.java b/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/JdbcRoutes.java
new file mode 100644
index 0000000000..ad47740886
--- /dev/null
+++ b/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/JdbcRoutes.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.jboss.logging.Logger;
+
+@ApplicationScoped
+public class JdbcRoutes extends RouteBuilder {
+    private static final Logger LOG = Logger.getLogger(JdbcRoutes.class);
+
+    @Override
+    public void configure() {
+        from("direct://get-generated-keys")
+                .to("jdbc:camel-ds")
+                .process(new Processor() {
+                    @Override
+                    public void process(Exchange exchange) throws Exception {
+                        Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+                        exchange.getIn().setBody(in);
+                    }
+                });
+
+        from("direct://get-headers")
+                .to("jdbc:camel-ds")
+                .process(new Processor() {
+                    @Override
+                    public void process(Exchange exchange) throws Exception {
+                        Object in = exchange.getIn().getHeaders();
+                        exchange.getIn().setBody(in);
+                    }
+                });
+
+        from("direct://headers-as-parameters")
+                .to("jdbc:camel-ds?useHeadersAsParameters=true");
+
+        from("timer://interval-polling?delay=2000&repeatCount=1").routeId("jdbc-poll").autoStartup(false)
+                .setBody(constant("select * from camelsGenerated order by id desc"))
+                .to("jdbc:camel-ds")
+                .to("mock:interval-polling");
+
+        from("direct://move-between-datasources")
+                .setBody(constant("select * from camels"))
+                .to("jdbc:camel-ds")
+                .split(body())
+                .setBody(simple("insert into camelsProcessed values('${body[ID]}','${body[SPECIES]}')"))
+                .to("jdbc:camel-ds");
+    }
+}
diff --git a/integration-tests/jdbc/src/test/java/org/apache/camel/quarkus/component/jdbc/CamelJdbcTest.java b/integration-tests/jdbc/src/test/java/org/apache/camel/quarkus/component/jdbc/CamelJdbcTest.java
index f29fefe0f4..9fe7dad4af 100644
--- a/integration-tests/jdbc/src/test/java/org/apache/camel/quarkus/component/jdbc/CamelJdbcTest.java
+++ b/integration-tests/jdbc/src/test/java/org/apache/camel/quarkus/component/jdbc/CamelJdbcTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.quarkus.component.jdbc;
 
+import java.util.List;
+
 import io.quarkus.test.common.QuarkusTestResource;
 import io.quarkus.test.h2.H2DatabaseTestResource;
 import io.quarkus.test.junit.QuarkusTest;
@@ -23,7 +25,11 @@ import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
 import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @QuarkusTest
 @QuarkusTestResource(H2DatabaseTestResource.class)
@@ -53,4 +59,109 @@ public class CamelJdbcTest {
                 .post("/test/execute")
                 .then().body(is("[{ID=3}, {ID=2}, {ID=1}]"));
     }
+
+    @Test
+    void testCamelRetrieveGeneratedKeysHeader() {
+        List generatedIDs = RestAssured.given()
+                .get("test/generated-keys/rows")
+                .then().extract().body()
+                .jsonPath().getList("ID");
+
+        String selectResult = RestAssured.given()
+                .contentType(ContentType.TEXT).body("select id from camelsGenerated")
+                .post("/test/execute")
+                .then().extract().body().asString();
+
+        generatedIDs.forEach(generatedID -> assertTrue(selectResult.contains(generatedID.toString())));
+    }
+
+    @Test
+    void testHeadersFromInsertOrUpdateQuery() {
+        RestAssured.given()
+                .get("test/headers/insert")
+                .then()
+                .body(containsString("CamelGeneratedKeysRowCount=2"))
+                .and()
+                .body(containsString("CamelJdbcUpdateCount=2"))
+                .and()
+                .body(containsString("CamelRetrieveGeneratedKeys=true"))
+                .and()
+                .body(not(containsString("CamelJdbcRowCount")))
+                .and()
+                .body(not(containsString("CamelJdbcColumnNames")))
+                .and()
+                .body(not(containsString("CamelJdbcParameters")))
+                .and()
+                .body(not(containsString("CamelGeneratedColumns")));
+    }
+
+    @Test
+    void testHeadersFromSelectQuery() {
+        RestAssured.given()
+                .get("test/headers/select")
+                .then()
+                .body(not(containsString("CamelGeneratedKeysRowCount")))
+                .and()
+                .body(not(containsString("CamelJdbcUpdateCount")))
+                .and()
+                .body(not(containsString("CamelRetrieveGeneratedKeys")))
+                .and()
+                .body(not(containsString("CamelJdbcParameters")))
+                .and()
+                .body(not(containsString("CamelGeneratedColumns")))
+                .and()
+                .body(containsString("CamelJdbcRowCount"))
+                .and()
+                .body(containsString("CamelJdbcColumnNames=[ID, SPECIES]"));
+    }
+
+    @Test
+    void testNamedParameters() {
+        RestAssured.given()
+                .get("test/named-parameters/headers-as-parameters")
+                .then()
+                .body(containsString("{ID=1, SPECIES=Camelus dromedarius}"))
+                .and()
+                .body(containsString("{ID=2, SPECIES=Camelus bactrianus}"));
+    }
+
+    @Test
+    void testCamelJdbcParametersHeader() {
+        RestAssured.given()
+                .get("test/named-parameters/headers-as-parameters-map")
+                .then()
+                .body(containsString("{ID=2, SPECIES=Camelus bactrianus}"));
+    }
+
+    @Test
+    void testTimeIntervalDatabasePolling() {
+        String selectResult = RestAssured.given()
+                .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+                .post("/test/execute")
+                .then().extract().body().asString();
+
+        RestAssured.given()
+                .body(selectResult)
+                .get("/test/interval-polling")
+                .then()
+                .statusCode(204);
+    }
+
+    @Test
+    void testMoveDataBetweenDatasources() {
+        String camelsDbResult = RestAssured.given()
+                .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+                .post("/test/execute")
+                .then().extract().body().asString();
+
+        RestAssured.given()
+                .post("test/move-between-datasources");
+
+        RestAssured.given()
+                .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+                .post("/test/execute")
+                .then()
+                .body(equalTo(camelsDbResult));
+    }
+
 }


[camel-quarkus] 02/06: Add missing @Component annotation to QuarkusVertxWebsocketComponent

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 235a7583e2985bc860a839b9031bafd1a8f43e1c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Apr 5 09:00:04 2023 +0100

    Add missing @Component annotation to QuarkusVertxWebsocketComponent
    
    Fixes #4741
---
 .../camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
index 0d35db7e53..061f41a3e6 100644
--- a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
+++ b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
@@ -27,6 +27,7 @@ import org.apache.camel.component.vertx.websocket.VertxWebsocketComponent;
 import org.apache.camel.component.vertx.websocket.VertxWebsocketHost;
 import org.apache.camel.component.vertx.websocket.VertxWebsocketHostConfiguration;
 import org.apache.camel.component.vertx.websocket.VertxWebsocketHostKey;
+import org.apache.camel.spi.annotations.Component;
 
 @Recorder
 public class VertxWebsocketRecorder {
@@ -39,6 +40,7 @@ public class VertxWebsocketRecorder {
         return new RuntimeValue<>(component);
     }
 
+    @Component("vertx-websocket")
     static final class QuarkusVertxWebsocketComponent extends VertxWebsocketComponent {
         @Override
         protected VertxWebsocketHost createVertxWebsocketHost(VertxWebsocketHostConfiguration hostConfiguration,