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 2022/03/09 10:34:32 UTC

[camel-quarkus] branch 2.7.x updated (b3a5801 -> f5366b8)

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

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


    from b3a5801  Exclude optional reactor-netty-http-brave
     new 6eb439f  Ensure correct camel-quarkus-examples branch for maintenance branch PRs
     new b931323  jsonpath: fix different number of ObjectMapper modules between JVM and native mode #3582
     new f73cfe7  xImprove camel-quarkus-bean-validator test coverage #3567
     new 04eac54  Upgrade Quarkus to 2.7.3.Final
     new dceda97  Manage mvel via cq:sync-versions to allow additional consistency checks
     new 545c583  Remove redundant workarounds for Kotlin compilation on JDK 17
     new 37252f3  Fix warnings in json dataformats itests
     new 092dcc3  file: fix a race condition where an exchange is missed due to a call to mockEndpoint.reset() #3584
     new cc4b8e7  Merge platform-http-engine tests with platform-http
     new a26fc80  Fix #3553 make beans of InterceptStrategy unremovable (#3593)
     new f5366b8  Upgrade Camel to 3.14.2

The 11 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:
 .github/workflows/ci-build.yaml                    |  14 +--
 .mvn/jvm.config                                    |   1 -
 docs/antora.yml                                    |   4 +-
 .../pages/reference/extensions/bean-validator.adoc |  30 ++++++
 .../deployment/CamelUnremovableBeansProcessor.java |  25 +++++
 .../core/runtime/CamelBeansUnremovableTest.java    |  25 +++++
 .../runtime/src/main/doc/limitations.adoc          |   2 +
 .../bean-validator/runtime/src/main/doc/usage.adoc |  20 ++++
 .../json/path/deployment/JsonPathProcessor.java    |   3 +
 .../component/netty/deployment/NettyProcessor.java |   7 ++
 .../rabbitmq/deployment/RabbitmqProcessor.java     |   6 ++
 .../bean/validator/it/BeanValidatorResource.java   |  21 ++--
 .../bean/validator/it/BeanValidatorRoute.java      |   4 +
 .../validator/it/ValidatorFactoryCustomizer.java   |  51 +++++----
 .../component/bean/validator/it/model/Car.java     |   3 +-
 .../bean/validator/it/model/OptionalChecks.java}   |   9 +-
 .../bean/validator/it/BeanValidatorTest.java       |  10 +-
 .../jackson/json/JacksonJsonResource.java          |  13 ++-
 .../jackson/xml/JacksonXmlResource.java            |  13 ++-
 .../component/dataformats/json/model/MyModule.java |   6 +-
 .../dataformats/jackson/xml/JacksonXmlTest.java    |   3 +-
 .../quarkus/component/file/it/FileResource.java    |  11 +-
 .../camel/quarkus/component/file/it/FileTest.java  |   6 ++
 integration-tests/google-storage/pom.xml           |   5 +
 .../storage/it/GoogleStorageTestResource.java      |  13 +--
 integration-tests/jsonpath/pom.xml                 |   2 +-
 .../component/json/path/it/JsonPathResource.java   |  11 +-
 .../json/path/it/JsonPathCharsetsTest.java         |  32 +++---
 integration-tests/platform-http-engine/pom.xml     | 120 ---------------------
 .../platform/http/it/PlatformHttpResource.java     |  57 ----------
 .../platform/http/it/PlatformHttpRouteBuilder.java |  27 -----
 .../src/main/resources/application.properties      |  21 ----
 .../http/server/it/PlatformHttpEngineIT.java       |  24 -----
 .../http/server/it/PlatformHttpEngineTest.java     |  58 ----------
 .../platform/http/it/PlatformHttpRouteBuilder.java |  27 +++++
 .../component/http/server/it/PlatformHttpTest.java |  14 +++
 integration-tests/pom.xml                          |   1 -
 pom.xml                                            |   8 +-
 tooling/scripts/test-categories.yaml               |   1 -
 39 files changed, 297 insertions(+), 411 deletions(-)
 delete mode 100644 .mvn/jvm.config
 create mode 100644 extensions/bean-validator/runtime/src/main/doc/limitations.adoc
 create mode 100644 extensions/bean-validator/runtime/src/main/doc/usage.adoc
 copy integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/RefLanguageRoutes.java => integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/ValidatorFactoryCustomizer.java (56%)
 copy integration-tests/{jslt/src/main/java/org/apache/camel/quarkus/component/jslt/it/MathFunctionStub.java => bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/OptionalChecks.java} (82%)
 delete mode 100644 integration-tests/platform-http-engine/pom.xml
 delete mode 100644 integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpResource.java
 delete mode 100644 integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
 delete mode 100644 integration-tests/platform-http-engine/src/main/resources/application.properties
 delete mode 100644 integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineIT.java
 delete mode 100644 integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineTest.java

[camel-quarkus] 11/11: Upgrade Camel to 3.14.2

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

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

commit f5366b882572556e7814730801d969cbe9ea081e
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Mar 8 12:45:21 2022 +0000

    Upgrade Camel to 3.14.2
---
 docs/antora.yml                                             |  2 +-
 .../quarkus/component/netty/deployment/NettyProcessor.java  |  7 +++++++
 .../component/rabbitmq/deployment/RabbitmqProcessor.java    |  6 ++++++
 integration-tests/google-storage/pom.xml                    |  5 +++++
 .../google/storage/it/GoogleStorageTestResource.java        | 13 +++++++------
 pom.xml                                                     |  4 ++--
 6 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index de3b53f..159321e 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -27,7 +27,7 @@ asciidoc:
 
     min-maven-version: 3.8.1 # replace ${min-maven-version}
     target-maven-version: 3.8.4 # replace ${target-maven-version}
-    camel-version: 3.14.1 # replace ${camel.version}
+    camel-version: 3.14.2 # replace ${camel.version}
     camel-docs-version: 3.14.x # replace ${camel.docs.components.version}
     quarkus-version: 2.7.3.Final # replace ${quarkus.version}
     graalvm-version: 21.3.1 # replace ${graalvm.version}
diff --git a/extensions/netty/deployment/src/main/java/org/apache/camel/quarkus/component/netty/deployment/NettyProcessor.java b/extensions/netty/deployment/src/main/java/org/apache/camel/quarkus/component/netty/deployment/NettyProcessor.java
index 0c6afba..2247b9a 100644
--- a/extensions/netty/deployment/src/main/java/org/apache/camel/quarkus/component/netty/deployment/NettyProcessor.java
+++ b/extensions/netty/deployment/src/main/java/org/apache/camel/quarkus/component/netty/deployment/NettyProcessor.java
@@ -18,7 +18,9 @@ package org.apache.camel.quarkus.component.netty.deployment;
 
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import org.apache.camel.quarkus.core.deployment.spi.CamelSerializationBuildItem;
+import org.apache.commons.pool2.impl.DefaultEvictionPolicy;
 
 class NettyProcessor {
 
@@ -33,4 +35,9 @@ class NettyProcessor {
     CamelSerializationBuildItem serialization() {
         return new CamelSerializationBuildItem();
     }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection() {
+        return new ReflectiveClassBuildItem(true, false, false, DefaultEvictionPolicy.class.getName());
+    }
 }
diff --git a/extensions/rabbitmq/deployment/src/main/java/org/apache/camel/quarkus/component/rabbitmq/deployment/RabbitmqProcessor.java b/extensions/rabbitmq/deployment/src/main/java/org/apache/camel/quarkus/component/rabbitmq/deployment/RabbitmqProcessor.java
index aaab1dc..edf9f9e 100644
--- a/extensions/rabbitmq/deployment/src/main/java/org/apache/camel/quarkus/component/rabbitmq/deployment/RabbitmqProcessor.java
+++ b/extensions/rabbitmq/deployment/src/main/java/org/apache/camel/quarkus/component/rabbitmq/deployment/RabbitmqProcessor.java
@@ -18,6 +18,8 @@ package org.apache.camel.quarkus.component.rabbitmq.deployment;
 
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.apache.commons.pool2.impl.DefaultEvictionPolicy;
 import org.jboss.logging.Logger;
 
 class RabbitmqProcessor {
@@ -30,4 +32,8 @@ class RabbitmqProcessor {
         return new FeatureBuildItem(FEATURE);
     }
 
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection() {
+        return new ReflectiveClassBuildItem(true, false, false, DefaultEvictionPolicy.class.getName());
+    }
 }
diff --git a/integration-tests/google-storage/pom.xml b/integration-tests/google-storage/pom.xml
index f91f922..fad54af 100644
--- a/integration-tests/google-storage/pom.xml
+++ b/integration-tests/google-storage/pom.xml
@@ -68,6 +68,11 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-support</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <profiles>
diff --git a/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java b/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
index 92c6cf5..234da5c 100644
--- a/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
+++ b/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
@@ -20,11 +20,13 @@ import java.util.HashMap;
 import java.util.Map;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import org.apache.camel.quarkus.test.AvailablePortFinder;
+import org.testcontainers.containers.FixedHostPortGenericContainer;
 import org.testcontainers.containers.GenericContainer;
 
 public class GoogleStorageTestResource implements QuarkusTestResourceLifecycleManager {
 
-    public static final int PORT = 4443;
+    public static final int PORT = AvailablePortFinder.getNextAvailable();
     public static final String CONTAINER_NAME = "fsouza/fake-gcs-server";
 
     private GenericContainer<?> container;
@@ -35,14 +37,13 @@ public class GoogleStorageTestResource implements QuarkusTestResourceLifecycleMa
         Map<String, String> properties = new HashMap<>();
 
         if (GoogleStorageHelper.usingMockBackend()) {
-
-            container = new GenericContainer<>(CONTAINER_NAME)
-                    .withExposedPorts(PORT)
+            container = new FixedHostPortGenericContainer<>(CONTAINER_NAME)
+                    .withFixedExposedPort(PORT, PORT)
                     .withCreateContainerCmdModifier(
-                            it -> it.withEntrypoint("/bin/fake-gcs-server", "-scheme", "http"));
+                            it -> it.withEntrypoint("/bin/fake-gcs-server", "-scheme", "http", "-port", String.valueOf(PORT)));
             container.start();
 
-            properties.put(GoogleStorageResource.PARAM_PORT, container.getMappedPort(PORT).toString());
+            properties.put(GoogleStorageResource.PARAM_PORT, String.valueOf(PORT));
         }
 
         return properties;
diff --git a/pom.xml b/pom.xml
index c0f9b39..ed8341b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-dependencies</artifactId>
-        <version>3.14.1</version>
+        <version>3.14.2</version>
     </parent>
 
     <groupId>org.apache.camel.quarkus</groupId>
@@ -40,7 +40,7 @@
 
         <!-- Primary dependencies - maintained manually -->
         <camel.major.minor>3.14</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
-        <camel.version>${camel.major.minor}.1</camel.version>
+        <camel.version>${camel.major.minor}.2</camel.version>
         <camel.docs.components.version>${camel.major.minor}.x</camel.docs.components.version><!-- the version in Camel's docs/components/antora.yml -->
         <camel.docs.components.xref>${camel.docs.components.version}@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
         <camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable camel branch on which our Antora docs depends -->

[camel-quarkus] 02/11: jsonpath: fix different number of ObjectMapper modules between JVM and native mode #3582

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

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

commit b931323458825b312b5d89d538228469fdf57af9
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Mar 1 09:06:15 2022 +0100

    jsonpath: fix different number of ObjectMapper modules between JVM and native mode #3582
---
 .../json/path/deployment/JsonPathProcessor.java    |  3 ++
 integration-tests/jsonpath/pom.xml                 |  2 +-
 .../component/json/path/it/JsonPathResource.java   | 11 +++++---
 .../json/path/it/JsonPathCharsetsTest.java         | 32 +++++++++++-----------
 4 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/extensions/jsonpath/deployment/src/main/java/org/apache/camel/quarkus/component/json/path/deployment/JsonPathProcessor.java b/extensions/jsonpath/deployment/src/main/java/org/apache/camel/quarkus/component/json/path/deployment/JsonPathProcessor.java
index 5e68144..1fa1321 100644
--- a/extensions/jsonpath/deployment/src/main/java/org/apache/camel/quarkus/component/json/path/deployment/JsonPathProcessor.java
+++ b/extensions/jsonpath/deployment/src/main/java/org/apache/camel/quarkus/component/json/path/deployment/JsonPathProcessor.java
@@ -41,6 +41,9 @@ class JsonPathProcessor {
         reflectiveClassBuildItems.add(new ReflectiveClassBuildItem(false, false, JsonPathAnnotationExpressionFactory.class));
         reflectiveClassBuildItems.add(new ReflectiveClassBuildItem(true, false, JsonPath.class));
         reflectiveClassBuildItems.add(new ReflectiveClassBuildItem(false, false, JacksonJsonAdapter.class));
+        reflectiveClassBuildItems
+                .add(new ReflectiveClassBuildItem(false, false, "com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule"));
+
         return reflectiveClassBuildItems;
     }
 
diff --git a/integration-tests/jsonpath/pom.xml b/integration-tests/jsonpath/pom.xml
index b71aac2..5ce95ab 100644
--- a/integration-tests/jsonpath/pom.xml
+++ b/integration-tests/jsonpath/pom.xml
@@ -45,7 +45,7 @@
         </dependency>
         <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy-jackson</artifactId>
+            <artifactId>quarkus-resteasy</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/jsonpath/src/main/java/org/apache/camel/quarkus/component/json/path/it/JsonPathResource.java b/integration-tests/jsonpath/src/main/java/org/apache/camel/quarkus/component/json/path/it/JsonPathResource.java
index c235593..2e6f91b 100644
--- a/integration-tests/jsonpath/src/main/java/org/apache/camel/quarkus/component/json/path/it/JsonPathResource.java
+++ b/integration-tests/jsonpath/src/main/java/org/apache/camel/quarkus/component/json/path/it/JsonPathResource.java
@@ -36,6 +36,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.commons.lang3.StringUtils;
 import org.jboss.logging.Logger;
 
 import static org.apache.camel.jsonpath.JsonPathConstants.HEADER_JSON_ENCODING;
@@ -133,19 +134,21 @@ public class JsonPathResource {
 
     @Path("/getAuthorsFromJsonStream")
     @GET
-    @Produces(MediaType.APPLICATION_JSON)
+    @Produces(MediaType.TEXT_PLAIN)
     @Consumes(MediaType.APPLICATION_OCTET_STREAM)
-    public List<?> getAuthorsFromJsonStream(byte[] jsonBytes, @QueryParam("encoding") String encoding) throws IOException {
+    public String getAuthorsFromJsonStream(byte[] jsonBytes, @QueryParam("encoding") String encoding) throws IOException {
         LOG.debugf("Getting authors from JsonStream with encoding '%s' and %d bytes", encoding, jsonBytes.length);
 
+        List<?> bookTitles;
         try (ByteArrayInputStream jsonStream = new ByteArrayInputStream(jsonBytes)) {
             if (encoding == null) {
-                return producerTemplate.requestBody("direct:getAuthorsFromJsonStream", jsonStream, List.class);
+                bookTitles = producerTemplate.requestBody("direct:getAuthorsFromJsonStream", jsonStream, List.class);
             } else {
-                return producerTemplate.requestBodyAndHeader("direct:getAuthorsFromJsonStream", jsonStream,
+                bookTitles = producerTemplate.requestBodyAndHeader("direct:getAuthorsFromJsonStream", jsonStream,
                         HEADER_JSON_ENCODING, encoding, List.class);
             }
         }
+        return StringUtils.join(bookTitles, "-");
     }
 
     @Path("/splitInputJsonThenWriteAsStringShouldSucceed")
diff --git a/integration-tests/jsonpath/src/test/java/org/apache/camel/quarkus/component/json/path/it/JsonPathCharsetsTest.java b/integration-tests/jsonpath/src/test/java/org/apache/camel/quarkus/component/json/path/it/JsonPathCharsetsTest.java
index 94a9b30..d12c097 100644
--- a/integration-tests/jsonpath/src/test/java/org/apache/camel/quarkus/component/json/path/it/JsonPathCharsetsTest.java
+++ b/integration-tests/jsonpath/src/test/java/org/apache/camel/quarkus/component/json/path/it/JsonPathCharsetsTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.io.IOUtils;
 import org.junit.jupiter.api.Test;
 
 import static io.restassured.RestAssured.given;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.hamcrest.Matchers.is;
 
 @QuarkusTest
 class JsonPathCharsetsTest {
@@ -31,31 +31,31 @@ class JsonPathCharsetsTest {
     @Test
     public void transformBooksUTF16BEShouldReturnTwoAuthors() throws IOException {
         byte[] body = IOUtils.resourceToByteArray("/booksUTF16BE.json");
-        String[] authors = given().body(body).get("/jsonpath/getAuthorsFromJsonStream").then().statusCode(200).extract()
-                .as(String[].class);
-        assertEquals(2, authors.length);
-        assertEquals("Sayings of the Century", authors[0]);
-        assertEquals("Sword of Honour", authors[1]);
+        given().body(body)
+                .get("/jsonpath/getAuthorsFromJsonStream")
+                .then()
+                .statusCode(200)
+                .body(is("Sayings of the Century-Sword of Honour"));
     }
 
     @Test
     public void transformBooksUTF16LEShouldReturnTwoAuthors() throws IOException {
         byte[] body = IOUtils.resourceToByteArray("/booksUTF16LE.json");
-        String[] authors = given().body(body).get("/jsonpath/getAuthorsFromJsonStream").then().statusCode(200).extract()
-                .as(String[].class);
-        assertEquals(2, authors.length);
-        assertEquals("Sayings of the Century", authors[0]);
-        assertEquals("Sword of Honour", authors[1]);
+        given().body(body)
+                .get("/jsonpath/getAuthorsFromJsonStream")
+                .then().statusCode(200)
+                .body(is("Sayings of the Century-Sword of Honour"));
     }
 
     @Test
     public void transformBooksIso_8859_1_ShouldReturnTwoAuthors() throws IOException {
         byte[] body = IOUtils.resourceToByteArray("/germanbooks-iso-8859-1.json");
-        String[] authors = given().queryParam("encoding", "ISO-8859-1").body(body).get("/jsonpath/getAuthorsFromJsonStream")
-                .then().statusCode(200).extract().as(String[].class);
-        assertEquals(2, authors.length);
-        assertEquals("Joseph und seine Brüder", authors[0]);
-        assertEquals("Götzendämmerung", authors[1]);
+        given().queryParam("encoding", "ISO-8859-1")
+                .body(body)
+                .get("/jsonpath/getAuthorsFromJsonStream")
+                .then()
+                .statusCode(200)
+                .body(is("Joseph und seine Brüder-Götzendämmerung"));
     }
 
 }

[camel-quarkus] 10/11: Fix #3553 make beans of InterceptStrategy unremovable (#3593)

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

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

commit a26fc80be60ae513407c7b23784aa3c54c859224
Author: Amos Feng <zh...@gmail.com>
AuthorDate: Tue Mar 8 19:38:41 2022 +0800

    Fix #3553 make beans of InterceptStrategy unremovable (#3593)
---
 .../deployment/CamelUnremovableBeansProcessor.java | 25 ++++++++++++++++++++++
 .../core/runtime/CamelBeansUnremovableTest.java    | 25 ++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelUnremovableBeansProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelUnremovableBeansProcessor.java
index 385a404..e3c2d72 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelUnremovableBeansProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelUnremovableBeansProcessor.java
@@ -30,11 +30,13 @@ import org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog;
 import org.apache.camel.quarkus.core.deployment.catalog.BuildTimeJsonSchemaResolver;
 import org.apache.camel.quarkus.core.deployment.catalog.SchemaResource;
 import org.apache.camel.quarkus.core.deployment.spi.BuildTimeCamelCatalogBuildItem;
+import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.spi.annotations.Dataformat;
 import org.apache.camel.spi.annotations.Language;
 import org.apache.camel.tooling.model.BaseOptionModel;
 import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.ClassInfo;
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.IndexView;
 import org.slf4j.Logger;
@@ -50,6 +52,10 @@ public class CamelUnremovableBeansProcessor {
             DotName.createSimple(Language.class.getName())
     };
 
+    private static final DotName[] OPTIONAL_SERVICE_TYPES = {
+            DotName.createSimple(InterceptStrategy.class.getName())
+    };
+
     @BuildStep
     BuildTimeCamelCatalogBuildItem buildTimeCamelCatalog(CombinedIndexBuildItem combinedIndex) {
         Set<SchemaResource> resources = new HashSet<>();
@@ -91,4 +97,23 @@ public class CamelUnremovableBeansProcessor {
 
         return UnremovableBeanBuildItem.beanTypes(unremovableClasses);
     }
+
+    @BuildStep
+    UnremovableBeanBuildItem unremovableOptionalServices(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        Set<DotName> unremovableClasses = Stream.of(OPTIONAL_SERVICE_TYPES)
+                .map(index::getAllKnownImplementors)
+                .flatMap(Collection::stream)
+                .map(ClassInfo::name)
+                .collect(Collectors.toSet());
+
+        if (LOGGER.isDebugEnabled()) {
+            unremovableClasses.stream().forEach(
+                    unremovableClass -> LOGGER.debug("Registering optional service unremovable bean class: {}",
+                            unremovableClass));
+        }
+
+        return UnremovableBeanBuildItem.beanTypes(unremovableClasses);
+    }
 }
diff --git a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/runtime/CamelBeansUnremovableTest.java b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/runtime/CamelBeansUnremovableTest.java
index ebf1645..fdb8e11 100644
--- a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/runtime/CamelBeansUnremovableTest.java
+++ b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/runtime/CamelBeansUnremovableTest.java
@@ -25,6 +25,9 @@ import javax.inject.Singleton;
 
 import io.quarkus.test.QuarkusUnitTest;
 import org.apache.camel.CamelContext;
+import org.apache.camel.NamedNode;
+import org.apache.camel.Processor;
+import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.Registry;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.spi.annotations.Dataformat;
@@ -76,6 +79,14 @@ public class CamelBeansUnremovableTest {
     }
 
     @Test
+    public void testInterceptStrategyUnremovable() {
+        Registry registry = context.getRegistry();
+        Set<UnremovableInterceptStrategy> unremovableInterceptStrategies = registry
+                .findByType(UnremovableInterceptStrategy.class);
+        Assertions.assertEquals(1, unremovableInterceptStrategies.size());
+    }
+
+    @Test
     public void testNonUnremovableBeansRemoved() {
         Registry registry = context.getRegistry();
         Set<Exception> nonUnremovableBeans = registry.findByType(Exception.class);
@@ -94,6 +105,14 @@ public class CamelBeansUnremovableTest {
     static final class UnremovableLanguageBean {
     }
 
+    static final class UnremovableInterceptStrategy implements InterceptStrategy {
+        @Override
+        public Processor wrapProcessorInInterceptors(CamelContext context, NamedNode definition, Processor target,
+                Processor nextTarget) throws Exception {
+            return target;
+        }
+    }
+
     @ApplicationScoped
     static final class BeanProducers {
 
@@ -123,6 +142,12 @@ public class CamelBeansUnremovableTest {
 
         @Singleton
         @Produces
+        public UnremovableInterceptStrategy unremovableInterceptStrategy() {
+            return new UnremovableInterceptStrategy();
+        }
+
+        @Singleton
+        @Produces
         public Exception removableBean() {
             return new Exception("java.lang types should not be auto added as unremovable");
         }

[camel-quarkus] 06/11: Remove redundant workarounds for Kotlin compilation on JDK 17

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

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

commit 545c583ec027f18966c6dc248635ed50dd30aec0
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Mar 4 07:45:44 2022 +0000

    Remove redundant workarounds for Kotlin compilation on JDK 17
---
 .github/workflows/ci-build.yaml | 6 ------
 .mvn/jvm.config                 | 1 -
 2 files changed, 7 deletions(-)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index 35e4d23..4d46d14 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -253,12 +253,6 @@ jobs:
     env:
       MAVEN_OPTS: -Xmx3000m
     steps:
-      - name: Setup jdk.compiler options for Kotlin Kapt
-        if: matrix.java == '17'
-        run: |
-          # Set additional options for Kotlin Kapt
-          # https://youtrack.jetbrains.com/issue/KT-43704
-          echo "MAVEN_OPTS=${{env.MAVEN_OPTS}} --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add- [...]
       - name: Setup apache-snapshots profile
         if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main'
         run: |
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
deleted file mode 100644
index e0f791e..0000000
--- a/.mvn/jvm.config
+++ /dev/null
@@ -1 +0,0 @@
---illegal-access=permit --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com. [...]
\ No newline at end of file

[camel-quarkus] 09/11: Merge platform-http-engine tests with platform-http

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

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

commit cc4b8e795240bff8264575e7189d165ae7f4c509
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Mar 8 08:21:31 2022 +0000

    Merge platform-http-engine tests with platform-http
---
 integration-tests/platform-http-engine/pom.xml     | 120 ---------------------
 .../platform/http/it/PlatformHttpResource.java     |  57 ----------
 .../platform/http/it/PlatformHttpRouteBuilder.java |  27 -----
 .../src/main/resources/application.properties      |  21 ----
 .../http/server/it/PlatformHttpEngineIT.java       |  24 -----
 .../http/server/it/PlatformHttpEngineTest.java     |  58 ----------
 .../platform/http/it/PlatformHttpRouteBuilder.java |  27 +++++
 .../component/http/server/it/PlatformHttpTest.java |  14 +++
 integration-tests/pom.xml                          |   1 -
 tooling/scripts/test-categories.yaml               |   1 -
 10 files changed, 41 insertions(+), 309 deletions(-)

diff --git a/integration-tests/platform-http-engine/pom.xml b/integration-tests/platform-http-engine/pom.xml
deleted file mode 100644
index 32b16fd..0000000
--- a/integration-tests/platform-http-engine/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?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.7.1-SNAPSHOT</version>
-        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
-    </parent>
-
-    <artifactId>camel-quarkus-integration-test-platform-http-engine</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Platform HTTP Engine</name>
-    <description>Integration tests for Camel Quarkus platform-http engine extension</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-platform-http</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-jsonb</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy-jsonb</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>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-
-    <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>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-platform-http-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-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpResource.java b/integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpResource.java
deleted file mode 100644
index 377c31c..0000000
--- a/integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpResource.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.platform.http.it;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.json.Json;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.camel.component.platform.http.PlatformHttpConstants;
-import org.apache.camel.spi.Registry;
-
-@Path("/test")
-@ApplicationScoped
-public class PlatformHttpResource {
-    @Inject
-    Registry registry;
-
-    @Path("/registry/inspect")
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public JsonObject inspectRegistry() {
-        JsonObjectBuilder builder = Json.createObjectBuilder();
-
-        Object engine = registry.lookupByName(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME);
-        Object component = registry.lookupByName(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME);
-
-        if (engine != null) {
-            builder.add(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME, engine.getClass().getName());
-        }
-
-        if (component != null) {
-            builder.add(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME, component.getClass().getName());
-        }
-
-        return builder.build();
-    }
-}
diff --git a/integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java b/integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
deleted file mode 100644
index f4ca019..0000000
--- a/integration-tests/platform-http-engine/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.platform.http.it;
-
-import org.apache.camel.builder.RouteBuilder;
-
-public class PlatformHttpRouteBuilder extends RouteBuilder {
-    @Override
-    public void configure() {
-        from("platform-http:/platform-http/hello?httpMethodRestrict=GET")
-                .setBody().constant("platform-http/hello");
-    }
-}
diff --git a/integration-tests/platform-http-engine/src/main/resources/application.properties b/integration-tests/platform-http-engine/src/main/resources/application.properties
deleted file mode 100644
index 768a767..0000000
--- a/integration-tests/platform-http-engine/src/main/resources/application.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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
-#
-quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
-quarkus.log.category."org.apache.camel.quarkus.component.platform.http".level = INFO
diff --git a/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineIT.java b/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineIT.java
deleted file mode 100644
index 0612638..0000000
--- a/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineIT.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.http.server.it;
-
-import io.quarkus.test.junit.NativeImageTest;
-
-@NativeImageTest
-class PlatformHttpEngineIT extends PlatformHttpEngineTest {
-
-}
diff --git a/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineTest.java b/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineTest.java
deleted file mode 100644
index 460c26b..0000000
--- a/integration-tests/platform-http-engine/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpEngineTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.http.server.it;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import org.apache.camel.component.platform.http.PlatformHttpComponent;
-import org.apache.camel.component.platform.http.PlatformHttpConstants;
-import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpEngine;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-
-@QuarkusTest
-class PlatformHttpEngineTest {
-    @Test
-    public void registrySetUp() {
-        RestAssured.given()
-                .get("/test/registry/inspect")
-                .then()
-                .statusCode(200)
-                .body(
-                        PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME, is(VertxPlatformHttpEngine.class.getName()),
-                        PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME, is(PlatformHttpComponent.class.getName()));
-    }
-
-    @Test
-    public void basic() {
-        RestAssured.given()
-                .get("/platform-http/hello")
-                .then()
-                .statusCode(200)
-                .body(equalTo("platform-http/hello"));
-    }
-
-    @Disabled("https://github.com/quarkusio/quarkus/issues/4408")
-    @Test
-    public void invalidMethod() {
-        RestAssured.post("/platform-http/hello")
-                .then().statusCode(405);
-    }
-}
diff --git a/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java b/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
index 46cdad9..0b315d1 100644
--- a/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
+++ b/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
@@ -30,9 +30,11 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.attachment.AttachmentMessage;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.platform.http.PlatformHttpConstants;
 import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConstants;
 import org.apache.camel.component.webhook.WebhookConfiguration;
 import org.apache.camel.model.rest.RestBindingMode;
+import org.apache.camel.spi.Registry;
 
 public class PlatformHttpRouteBuilder extends RouteBuilder {
     @SuppressWarnings("unchecked")
@@ -55,6 +57,31 @@ public class PlatformHttpRouteBuilder extends RouteBuilder {
                 .setBody(constant("POST: /rest-post"))
                 .endRest();
 
+        from("platform-http:/registry/inspect")
+                .process(e -> {
+                    Registry registry = e.getContext().getRegistry();
+
+                    Object engine = registry.lookupByName(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME);
+                    Object component = registry.lookupByName(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME);
+
+                    String engineClassName = "";
+                    String componentClassName = "";
+
+                    if (engine != null) {
+                        engineClassName = engine.getClass().getName();
+                    }
+
+                    if (component != null) {
+                        componentClassName = component.getClass().getName();
+                    }
+
+                    String json = String.format("{\"engine\": \"%s\", \"component\": \"%s\"}", engineClassName,
+                            componentClassName);
+                    Message message = e.getMessage();
+                    message.setHeader(Exchange.CONTENT_TYPE, "application/json");
+                    message.setBody(json);
+                });
+
         from("platform-http:/platform-http/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
         from("platform-http:/platform-http/get-post?httpMethodRestrict=GET,POST").setBody(simple("Hello ${body}"));
 
diff --git a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
index 2060398..6a782c7 100644
--- a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
+++ b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
@@ -23,6 +23,8 @@ import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
 import io.restassured.http.Method;
+import org.apache.camel.component.platform.http.PlatformHttpComponent;
+import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpEngine;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
@@ -30,6 +32,7 @@ import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 
 import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.Matchers.notNullValue;
 
 @QuarkusTest
@@ -347,6 +350,17 @@ class PlatformHttpTest {
                 .body(equalTo("camel:Admin"));
     }
 
+    @Test
+    public void registrySetUp() {
+        RestAssured.given()
+                .get("/registry/inspect")
+                .then()
+                .statusCode(200)
+                .body(
+                        "engine", is(VertxPlatformHttpEngine.class.getName()),
+                        "component", is(PlatformHttpComponent.class.getName()));
+    }
+
     private static Method[] httpMethods() {
         return Method.values();
     }
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 306a9e7..c00101d 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -168,7 +168,6 @@
         <module>pg-replication-slot</module>
         <module>pgevent</module>
         <module>platform-http</module>
-        <module>platform-http-engine</module>
         <module>protobuf</module>
         <module>pubnub</module>
         <module>quartz</module>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index 1dc2a95..c68a4f8 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -184,7 +184,6 @@ group-12:
   - opentracing
   - paho-mqtt5
   - platform-http
-  - platform-http-engine
   - reactive-streams
   - rest
   - rest-openapi

[camel-quarkus] 03/11: xImprove camel-quarkus-bean-validator test coverage #3567

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

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

commit f73cfe7325e826e024d19d9da28dd4e82327be60
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Wed Feb 23 12:01:27 2022 +0100

    xImprove camel-quarkus-bean-validator test coverage #3567
---
 .../pages/reference/extensions/bean-validator.adoc | 30 ++++++++++++
 .../runtime/src/main/doc/limitations.adoc          |  2 +
 .../bean-validator/runtime/src/main/doc/usage.adoc | 20 ++++++++
 .../bean/validator/it/BeanValidatorResource.java   | 21 ++++++---
 .../bean/validator/it/BeanValidatorRoute.java      |  4 ++
 .../validator/it/ValidatorFactoryCustomizer.java   | 55 ++++++++++++++++++++++
 .../component/bean/validator/it/model/Car.java     |  3 +-
 .../OptionalChecks.java}                           | 15 ++----
 .../bean/validator/it/BeanValidatorTest.java       | 10 +++-
 9 files changed, 139 insertions(+), 21 deletions(-)

diff --git a/docs/modules/ROOT/pages/reference/extensions/bean-validator.adoc b/docs/modules/ROOT/pages/reference/extensions/bean-validator.adoc
index c983099..89a9c98 100644
--- a/docs/modules/ROOT/pages/reference/extensions/bean-validator.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/bean-validator.adoc
@@ -38,3 +38,33 @@ Or add the coordinates to your existing project:
 ----
 
 Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Usage
+
+=== Configuring the ValidatorFactory
+
+Implementation of this extension leverages the https://quarkus.io/guides/validation[Quarkus Hibernate Validator extension].
+
+Therefore it is not possible to configure the `ValidatorFactory` by Camel's properties ('constraintValidatorFactory`, `messageInterpolator`, `traversableResolver`, `validationProviderResolver` and `validatorFactory`).
+
+You can configure the `ValidatorFactory` by the creation of beans which will be injected into the default `ValidatorFactory` (created by Quarkus).
+See the https://quarkus.io/guides/validation#hibernate-validator-extension-and-cdi[Quarkus CDI documentation] for more information.
+
+=== Custom validation groups in native mode
+
+When using custom validation groups in native mode, all the interfaces need to be registered for reflection (see the https://quarkus.io/guides/writing-native-applications-tips#register-reflection[documentation]).
+
+Example:
+[source,java]
+----
+@RegisterForReflection
+public interface OptionalChecks {
+}
+----
+
+
+== Camel Quarkus limitations
+
+It is not possible to describe your constraints as XML (by providing the file META-INF/validation.xml), only Java annotations are supported.
+This is caused by the limitation of the Quarkus Hibernate Validator extension (see the https://github.com/quarkusio/quarkus/issues/24027[issue]).
+
diff --git a/extensions/bean-validator/runtime/src/main/doc/limitations.adoc b/extensions/bean-validator/runtime/src/main/doc/limitations.adoc
new file mode 100644
index 0000000..8d0ed15
--- /dev/null
+++ b/extensions/bean-validator/runtime/src/main/doc/limitations.adoc
@@ -0,0 +1,2 @@
+It is not possible to describe your constraints as XML (by providing the file META-INF/validation.xml), only Java annotations are supported.
+This is caused by the limitation of the Quarkus Hibernate Validator extension (see the https://github.com/quarkusio/quarkus/issues/24027[issue]).
\ No newline at end of file
diff --git a/extensions/bean-validator/runtime/src/main/doc/usage.adoc b/extensions/bean-validator/runtime/src/main/doc/usage.adoc
new file mode 100644
index 0000000..1c85a6f
--- /dev/null
+++ b/extensions/bean-validator/runtime/src/main/doc/usage.adoc
@@ -0,0 +1,20 @@
+=== Configuring the ValidatorFactory
+
+Implementation of this extension leverages the https://quarkus.io/guides/validation[Quarkus Hibernate Validator extension].
+
+Therefore it is not possible to configure the `ValidatorFactory` by Camel's properties ('constraintValidatorFactory`, `messageInterpolator`, `traversableResolver`, `validationProviderResolver` and `validatorFactory`).
+
+You can configure the `ValidatorFactory` by the creation of beans which will be injected into the default `ValidatorFactory` (created by Quarkus).
+See the https://quarkus.io/guides/validation#hibernate-validator-extension-and-cdi[Quarkus CDI documentation] for more information.
+
+=== Custom validation groups in native mode
+
+When using custom validation groups in native mode, all the interfaces need to be registered for reflection (see the https://quarkus.io/guides/writing-native-applications-tips#register-reflection[documentation]).
+
+Example:
+[source,java]
+----
+@RegisterForReflection
+public interface OptionalChecks {
+}
+----
diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java
index 5bf17e0..e648a14 100644
--- a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java
+++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java
@@ -39,18 +39,27 @@ public class BeanValidatorResource {
     @Inject
     ProducerTemplate producerTemplate;
 
-    @Path("/get/{manufactor}/{plate}")
+    @Inject
+    ValidatorFactoryCustomizer.MyMessageInterpolator messageInterpolator;
+
+    @Path("/get/{optional}/{manufactor}/{plate}")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
-    public Response get(@PathParam("manufactor") String manufactor, @PathParam("plate") String plate) throws Exception {
-        LOG.info("bean-validator: " + manufactor + "/" + plate);
-        Car car = new Car(manufactor, plate);
-        Exchange out = producerTemplate.request("direct:start", e -> e.getMessage().setBody(car));
+    public Response get(@PathParam("optional") String endpoint, @PathParam("manufactor") String manufactor,
+            @PathParam("plate") String plate) throws Exception {
+        return get(new Car(manufactor, plate), endpoint);
+    }
+
+    private Response get(Car car, String endpoint) throws Exception {
+        LOG.info("bean-validator: " + car.getManufacturer() + "/" + car.getLicensePlate());
+        Exchange out = producerTemplate.request("direct:" + endpoint, e -> e.getMessage().setBody(car));
+        if (messageInterpolator.getCount() == 0) {
+            return Response.status(500, "Interpolator was not used.").build();
+        }
         if (out.isFailed()) {
             return Response.status(400, "Invalid car").build();
         } else {
             return Response.status(200, "OK").build();
         }
     }
-
 }
diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java
index 76a7c7d..cc4e30e 100644
--- a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java
+++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java
@@ -26,5 +26,9 @@ public class BeanValidatorRoute extends RouteBuilder {
 
         from("direct:start")
                 .to("bean-validator:car");
+
+        from("direct:optional")
+                .to("bean-validator:xmlCar?group=org.apache.camel.quarkus.component.bean.validator.it.model.OptionalChecks");
     }
+
 }
diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/ValidatorFactoryCustomizer.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/ValidatorFactoryCustomizer.java
new file mode 100644
index 0000000..6e797f4
--- /dev/null
+++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/ValidatorFactoryCustomizer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.bean.validator.it;
+
+import java.util.Locale;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Singleton;
+import javax.validation.MessageInterpolator;
+
+@ApplicationScoped
+public class ValidatorFactoryCustomizer {
+
+    @Produces
+    @Singleton
+    public MyMessageInterpolator createMyMessageInterpolator() {
+        return new MyMessageInterpolator();
+    }
+
+    class MyMessageInterpolator implements MessageInterpolator {
+
+        private int count = 0;
+
+        @Override
+        public String interpolate(String messageTemplate, Context context) {
+            count++;
+            return null;
+        }
+
+        @Override
+        public String interpolate(String messageTemplate, Context context, Locale locale) {
+            count++;
+            return null;
+        }
+
+        public int getCount() {
+            return count;
+        }
+    }
+}
diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java
index 19db6f8..a184516 100644
--- a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java
+++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java
@@ -25,7 +25,7 @@ public class Car {
     private String manufacturer;
 
     @NotNull
-    @Size(min = 5, max = 14)
+    @Size(min = 5, max = 14, groups = OptionalChecks.class)
     private String licensePlate;
 
     public Car(String manufacturer, String licencePlate) {
@@ -48,5 +48,4 @@ public class Car {
     public void setLicensePlate(String licensePlate) {
         this.licensePlate = licensePlate;
     }
-
 }
diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/OptionalChecks.java
similarity index 70%
copy from integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java
copy to integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/OptionalChecks.java
index 76a7c7d..fc40952 100644
--- a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java
+++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/OptionalChecks.java
@@ -14,17 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.bean.validator.it;
+package org.apache.camel.quarkus.component.bean.validator.it.model;
 
-import org.apache.camel.builder.RouteBuilder;
+import io.quarkus.runtime.annotations.RegisterForReflection;
 
-public class BeanValidatorRoute extends RouteBuilder {
-
-    @Override
-    public void configure() throws Exception {
-        errorHandler(noErrorHandler());
-
-        from("direct:start")
-                .to("bean-validator:car");
-    }
+@RegisterForReflection
+public interface OptionalChecks {
 }
diff --git a/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java
index 8e91c67..9a31d80 100644
--- a/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java
+++ b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java
@@ -25,9 +25,15 @@ class BeanValidatorTest {
 
     @Test
     public void test() {
-        RestAssured.get("/bean-validator/get/honda/123").then().statusCode(400);
+        //forced optional check
+        RestAssured.get("/bean-validator/get/optional/honda/123").then().statusCode(400);
+        //forced optional check
+        RestAssured.get("/bean-validator/get/optional/honda/DD-AB-123").then().statusCode(200);
+        //not-forced optional check
+        RestAssured.get("/bean-validator/get/start/honda/123").then().statusCode(200);
+        //not-forced optional check
+        RestAssured.get("/bean-validator/get/start/honda/DD-AB-12").then().statusCode(200);
 
-        RestAssured.get("/bean-validator/get/honda/DD-AB-123").then().statusCode(200);
     }
 
 }

[camel-quarkus] 04/11: Upgrade Quarkus to 2.7.3.Final

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

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

commit 04eac54d64a0209134489822462a00905f2315c4
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Mar 2 15:56:02 2022 +0000

    Upgrade Quarkus to 2.7.3.Final
---
 docs/antora.yml | 2 +-
 pom.xml         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index 44d86eb..de3b53f 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -29,7 +29,7 @@ asciidoc:
     target-maven-version: 3.8.4 # replace ${target-maven-version}
     camel-version: 3.14.1 # replace ${camel.version}
     camel-docs-version: 3.14.x # replace ${camel.docs.components.version}
-    quarkus-version: 2.7.2.Final # replace ${quarkus.version}
+    quarkus-version: 2.7.3.Final # replace ${quarkus.version}
     graalvm-version: 21.3.1 # replace ${graalvm.version}
     graalvm-docs-version: 21.3
     # attributes used in xrefs to other Antora components
diff --git a/pom.xml b/pom.xml
index 4853216..6909c74 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,7 @@
         <quarkiverse-jsch.version>1.0.0</quarkiverse-jsch.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/jsch/quarkus-jsch-parent/ -->
         <quarkiverse-minio.version>2.3.0</quarkiverse-minio.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/minio/quarkus-minio-parent/ -->
         <quarkiverse-tika.version>1.0.3</quarkiverse-tika.version><!-- https://repo1.maven.org/maven2/io/quarkiverse/tika/quarkus-tika-parent/ -->
-        <quarkus.version>2.7.2.Final</quarkus.version><!-- https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/ -->
+        <quarkus.version>2.7.3.Final</quarkus.version><!-- https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/ -->
         <quarkus-hazelcast-client.version>2.0.0</quarkus-hazelcast-client.version><!-- https://repo1.maven.org/maven2/com/hazelcast/quarkus-hazelcast-client-bom/ -->
         <quarkus-qpid-jms.version>0.32.0</quarkus-qpid-jms.version><!-- https://repo1.maven.org/maven2/org/amqphub/quarkus/quarkus-qpid-jms-bom/ -->
 

[camel-quarkus] 05/11: Manage mvel via cq:sync-versions to allow additional consistency checks

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

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

commit dceda97f076b2f6e5e049739f1041c3192def09c
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Mar 2 22:37:46 2022 +0100

    Manage mvel via cq:sync-versions to allow additional consistency checks
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 6909c74..c0f9b39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -115,7 +115,7 @@
         <kotlin.version>1.6.10</kotlin.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.jetbrains.kotlin:kotlin-stdlib -->
         <libthrift.version>${libthrift-version}</libthrift.version> <!-- Spark -->
         <metrics.version>${metrics-version}</metrics.version><!-- Spark -->
-        <mvel2.version>${mvel-version}</mvel2.version>
+        <mvel2.version>2.4.13.Final</mvel2.version><!-- @sync org.apache.camel:camel-dependencies:${camel.version} prop:mvel-version -->
         <okio.version>${squareup-okio-version}</okio.version>
         <protobuf.version>3.19.3</protobuf.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:com.google.protobuf:protobuf-java -->
         <retrofit.version>2.5.0</retrofit.version>

[camel-quarkus] 07/11: Fix warnings in json dataformats itests

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

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

commit 37252f3e1d4b815b2e3204ad4b61b1ba85a82fc6
Author: aldettinger <al...@gmail.com>
AuthorDate: Fri Mar 4 17:43:07 2022 +0100

    Fix warnings in json dataformats itests
---
 .../dataformats/jackson/json/JacksonJsonResource.java       | 13 ++++++-------
 .../dataformats/jackson/xml/JacksonXmlResource.java         | 13 ++++++-------
 .../quarkus/component/dataformats/json/model/MyModule.java  |  6 ++++--
 .../component/dataformats/jackson/xml/JacksonXmlTest.java   |  3 +--
 4 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
index 8a9e55a..33d865e 100644
--- a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
+++ b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
@@ -53,7 +53,6 @@ import org.jboss.logging.Logger;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @Path("/dataformats-json")
 @ApplicationScoped
@@ -100,7 +99,7 @@ public class JacksonJsonResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
@@ -184,18 +183,18 @@ public class JacksonJsonResource {
         Exchange out = producerTemplate.request("direct:jackson-marshal-ct-yes", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertEquals("application/json", out.getMessage().getHeader(Exchange.CONTENT_TYPE));
         out = producerTemplate.request("direct:jackson-marshal-ct-yes2", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertEquals("application/json", out.getMessage().getHeader(Exchange.CONTENT_TYPE));
 
         out = producerTemplate.request("direct:jackson-marshal-ct-no", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertNull(out.getMessage().getHeader(Exchange.CONTENT_TYPE));
     }
 
@@ -334,7 +333,7 @@ public class JacksonJsonResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
@@ -460,7 +459,7 @@ public class JacksonJsonResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
diff --git a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
index 7c1d122..590b71c 100644
--- a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
+++ b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
@@ -50,7 +50,6 @@ import org.jboss.logging.Logger;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @Path("/dataformats-json")
 @ApplicationScoped
@@ -91,7 +90,7 @@ public class JacksonXmlResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
@@ -149,18 +148,18 @@ public class JacksonXmlResource {
         Exchange out = producerTemplate.request("direct:jacksonxml-marshal-ct-yes", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertEquals("application/xml", out.getMessage().getHeader(Exchange.CONTENT_TYPE));
         out = producerTemplate.request("direct:jacksonxml-marshal-ct-yes2", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertEquals("application/xml", out.getMessage().getHeader(Exchange.CONTENT_TYPE));
 
         out = producerTemplate.request("direct:jacksonxml-marshal-ct-no", exchange -> exchange.getIn().setBody(in));
 
         assertNotNull(out);
-        assertTrue(out.hasOut());
+        assertNotNull(out.getMessage());
         assertNull(out.getMessage().getHeader(Exchange.CONTENT_TYPE));
     }
 
@@ -259,7 +258,7 @@ public class JacksonXmlResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
@@ -334,7 +333,7 @@ public class JacksonXmlResource {
 
         mock.assertIsSatisfied();
 
-        List list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
+        List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
         assertNotNull(list);
         assertEquals(2, list.size());
 
diff --git a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/json/model/MyModule.java b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/json/model/MyModule.java
index aeb42d2..0af321c 100644
--- a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/json/model/MyModule.java
+++ b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/json/model/MyModule.java
@@ -18,7 +18,7 @@ package org.apache.camel.quarkus.component.dataformats.json.model;
 
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.Module;
-import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
 import io.quarkus.runtime.annotations.RegisterForReflection;
 
 @RegisterForReflection
@@ -36,7 +36,9 @@ public class MyModule extends Module {
 
     @Override
     public void setupModule(SetupContext context) {
-        context.setNamingStrategy(new PropertyNamingStrategy.PropertyNamingStrategyBase() {
+        context.setNamingStrategy(new PropertyNamingStrategies.NamingBase() {
+            private static final long serialVersionUID = 1L;
+
             @Override
             public String translate(String propertyName) {
                 return "my-" + propertyName;
diff --git a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
index affdb23..bd1893c 100644
--- a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
+++ b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
@@ -74,7 +74,7 @@ public class JacksonXmlTest {
                 .statusCode(200)
                 .body(equalTo(listJson));
         await().atMost(10, TimeUnit.SECONDS).until(() -> {
-            List<DummyObject> records = RestAssured.given()
+            List<?> records = RestAssured.given()
                     .contentType("text/xml")
                     .body(json)
                     .post("/dataformats-json/jacksonxml/unmarshal-listsplit")
@@ -84,7 +84,6 @@ public class JacksonXmlTest {
 
             return records.size() == 2;
         });
-
     }
 
     @Test

[camel-quarkus] 08/11: file: fix a race condition where an exchange is missed due to a call to mockEndpoint.reset() #3584

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

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

commit 092dcc3ba0c09c98502367017828314a00ddb1cc
Author: aldettinger <al...@gmail.com>
AuthorDate: Mon Mar 7 11:26:17 2022 +0100

    file: fix a race condition where an exchange is missed due to a call to mockEndpoint.reset() #3584
---
 .../apache/camel/quarkus/component/file/it/FileResource.java  | 11 ++++++++---
 .../org/apache/camel/quarkus/component/file/it/FileTest.java  |  6 ++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/integration-tests/file/src/main/java/org/apache/camel/quarkus/component/file/it/FileResource.java b/integration-tests/file/src/main/java/org/apache/camel/quarkus/component/file/it/FileResource.java
index 3695917..e5b8f79 100644
--- a/integration-tests/file/src/main/java/org/apache/camel/quarkus/component/file/it/FileResource.java
+++ b/integration-tests/file/src/main/java/org/apache/camel/quarkus/component/file/it/FileResource.java
@@ -91,17 +91,22 @@ public class FileResource {
 
     @Path("/getFromMock/{mockId}")
     @GET
-    public String getFromMock(@PathParam("mockId") String mockId) throws Exception {
+    public String getFromMock(@PathParam("mockId") String mockId) {
         MockEndpoint mockEndpoint = context.getEndpoint("mock:" + mockId, MockEndpoint.class);
 
         String result = mockEndpoint.getExchanges().stream().map(e -> e.getIn().getBody(String.class))
                 .collect(Collectors.joining(SEPARATOR));
 
-        mockEndpoint.reset();
-
         return result;
     }
 
+    @Path("/resetMock/{mockId}")
+    @GET
+    public void resetMock(@PathParam("mockId") String mockId) {
+        MockEndpoint mockEndpoint = context.getEndpoint("mock:" + mockId, MockEndpoint.class);
+        mockEndpoint.reset();
+    }
+
     @Path("/create/{folder}")
     @POST
     @Consumes(MediaType.APPLICATION_OCTET_STREAM)
diff --git a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java
index ded7443..2922d7d 100644
--- a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java
+++ b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java
@@ -141,6 +141,12 @@ class FileTest {
                         .extract().asString(),
                 equalTo(FILE_CONTENT_01));
 
+        // clear the mock to assert that FILE_CONTENT_01 will not be received again even if presented a second time to the route
+        RestAssured
+                .get("/file/resetMock/idempotent")
+                .then()
+                .statusCode(204);
+
         // move file back
         Path donePath = Paths.get(fileName01.replaceFirst("target/idempotent", "target/idempotent/done"));
         Path targetPath = Paths.get(fileName01);

[camel-quarkus] 01/11: Ensure correct camel-quarkus-examples branch for maintenance branch PRs

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

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

commit 6eb439fb13caece69bebf0bc4c69852fd545cada
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Feb 24 08:58:40 2022 +0000

    Ensure correct camel-quarkus-examples branch for maintenance branch PRs
    
    Fixes #3574
---
 .github/workflows/ci-build.yaml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index 9873811..35e4d23 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -427,7 +427,13 @@ jobs:
         run: echo "CQ_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
       - name: clone and verify examples
         run: |
-          git clone --depth 1 --branch camel-quarkus-main https://github.com/apache/camel-quarkus-examples.git \
+          EXAMPLES_BRANCH="camel-quarkus-main"
+
+          if [[ ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.x ]]; then
+              EXAMPLES_BRANCH=${GITHUB_REF_NAME}
+          fi
+
+          git clone --depth 1 --branch ${EXAMPLES_BRANCH} https://github.com/apache/camel-quarkus-examples.git \
             && cd camel-quarkus-examples \
             && echo "Current Examples commit:" $(git rev-parse HEAD) \
             && mvn ${MAVEN_ARGS} ${BRANCH_OPTIONS} org.l2x6.cq:cq-maven-plugin:2.10.0:examples-set-platform -Dcq.camel-quarkus.version=${CQ_VERSION} \