You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/12/23 17:20:27 UTC

[camel-quarkus] branch json-patch-jvm-ext created (now 4d97a2e)

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

acosentino pushed a change to branch json-patch-jvm-ext
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


      at 4d97a2e  Added Json-Patch Extension

This branch includes the following new commits:

     new befd834  Added Json-Patch Extension
     new 7199742  Added Json-Patch Extension
     new 39eebd5  Added Json-Patch Extension
     new 4d97a2e  Added Json-Patch Extension

The 4 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.


[camel-quarkus] 04/04: Added Json-Patch Extension

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

acosentino pushed a commit to branch json-patch-jvm-ext
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 4d97a2ecab18ad8ee96c9fc1e0109798c66764ec
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 23 18:18:05 2021 +0100

    Added Json-Patch Extension
---
 .../camel/quarkus/component/json/patch/it/JsonPatchResource.java      | 4 ----
 .../apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java   | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java b/integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
index f2bff4f..e0dbaf0 100644
--- a/integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
+++ b/integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
@@ -16,13 +16,9 @@
  */
 package org.apache.camel.quarkus.component.json.patch.it;
 
-import java.net.URI;
-
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
-import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
diff --git a/integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java b/integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
index 1b004e6..01ec4c1 100644
--- a/integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
+++ b/integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
@@ -18,9 +18,6 @@ package org.apache.camel.quarkus.component.json.patch.it;
 
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
-import io.restassured.http.ContentType;
-
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
 @QuarkusTest

[camel-quarkus] 03/04: Added Json-Patch Extension

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

acosentino pushed a commit to branch json-patch-jvm-ext
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 39eebd5452308ffa7d0b8faa5545615ed4d01b12
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 23 15:35:04 2021 +0100

    Added Json-Patch Extension
---
 extensions-jvm/json-patch/runtime/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/extensions-jvm/json-patch/runtime/pom.xml b/extensions-jvm/json-patch/runtime/pom.xml
index 778bffe..5b24af0 100644
--- a/extensions-jvm/json-patch/runtime/pom.xml
+++ b/extensions-jvm/json-patch/runtime/pom.xml
@@ -56,6 +56,12 @@
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-json-patch</artifactId>
+            <exclusions>
+               <exclusion>
+                  <groupId>com.google.code.findbugs</groupId>
+                  <artifactId>jsr305</artifactId>
+               </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 

[camel-quarkus] 01/04: Added Json-Patch Extension

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

acosentino pushed a commit to branch json-patch-jvm-ext
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit befd834a8f9c5bc9c134017ef41b22d4387007dc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 23 08:11:38 2021 +0100

    Added Json-Patch Extension
---
 extensions-jvm/json-patch/deployment/pom.xml       |  63 ++++++++++++
 .../json/patch/deployment/JsonPatchProcessor.java  |  46 +++++++++
 extensions-jvm/json-patch/pom.xml                  |  39 +++++++
 extensions-jvm/json-patch/runtime/pom.xml          | 112 +++++++++++++++++++++
 .../main/resources/META-INF/quarkus-extension.yaml |  32 ++++++
 extensions-jvm/pom.xml                             |   1 +
 integration-tests/json-patch/pom.xml               | 103 +++++++++++++++++++
 .../component/json/patch/it/JsonPatchResource.java |  55 ++++++++++
 .../component/json/patch/it/JsonPatchTest.java     |  37 +++++++
 integration-tests/pom.xml                          |   1 +
 poms/bom/pom.xml                                   |  15 +++
 11 files changed, 504 insertions(+)

diff --git a/extensions-jvm/json-patch/deployment/pom.xml b/extensions-jvm/json-patch/deployment/pom.xml
new file mode 100644
index 0000000..87f4f6e
--- /dev/null
+++ b/extensions-jvm/json-patch/deployment/pom.xml
@@ -0,0 +1,63 @@
+<?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-json-patch-parent</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-json-patch-deployment</artifactId>
+    <name>Camel Quarkus :: JsonPatch :: Deployment</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core-deployment</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-json-patch</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>io.quarkus</groupId>
+                            <artifactId>quarkus-extension-processor</artifactId>
+                            <version>${quarkus.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/extensions-jvm/json-patch/deployment/src/main/java/org/apache/camel/quarkus/component/json/patch/deployment/JsonPatchProcessor.java b/extensions-jvm/json-patch/deployment/src/main/java/org/apache/camel/quarkus/component/json/patch/deployment/JsonPatchProcessor.java
new file mode 100644
index 0000000..0e90409
--- /dev/null
+++ b/extensions-jvm/json-patch/deployment/src/main/java/org/apache/camel/quarkus/component/json/patch/deployment/JsonPatchProcessor.java
@@ -0,0 +1,46 @@
+/*
+ * 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.json.patch.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.pkg.steps.NativeBuild;
+import org.apache.camel.quarkus.core.JvmOnlyRecorder;
+import org.jboss.logging.Logger;
+
+class JsonPatchProcessor {
+
+    private static final Logger LOG = Logger.getLogger(JsonPatchProcessor.class);
+    private static final String FEATURE = "camel-json-patch";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    /**
+     * Remove this once this extension starts supporting the native mode.
+     */
+    @BuildStep(onlyIf = NativeBuild.class)
+    @Record(value = ExecutionTime.RUNTIME_INIT)
+    void warnJvmInNative(JvmOnlyRecorder recorder) {
+        JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+        recorder.warnJvmInNative(FEATURE); // warn at runtime
+    }
+}
diff --git a/extensions-jvm/json-patch/pom.xml b/extensions-jvm/json-patch/pom.xml
new file mode 100644
index 0000000..f680858
--- /dev/null
+++ b/extensions-jvm/json-patch/pom.xml
@@ -0,0 +1,39 @@
+<?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-extensions-jvm</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-json-patch-parent</artifactId>
+    <name>Camel Quarkus :: JsonPatch</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>deployment</module>
+        <module>runtime</module>
+    </modules>
+</project>
diff --git a/extensions-jvm/json-patch/runtime/pom.xml b/extensions-jvm/json-patch/runtime/pom.xml
new file mode 100644
index 0000000..778bffe
--- /dev/null
+++ b/extensions-jvm/json-patch/runtime/pom.xml
@@ -0,0 +1,112 @@
+<?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-json-patch-parent</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-json-patch</artifactId>
+    <name>Camel Quarkus :: JsonPatch :: Runtime</name>
+    <description>JsonPatch component which transform JSON using JSON patch (RFC 6902).</description>
+
+    <properties>
+        <camel.quarkus.jvmSince>2.7.0</camel.quarkus.jvmSince>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-json-patch</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.quarkus</groupId>
+                <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>io.quarkus</groupId>
+                            <artifactId>quarkus-extension-processor</artifactId>
+                            <version>${quarkus.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+
+    <profiles>
+        <profile>
+            <id>full</id>
+            <activation>
+                <property>
+                    <name>!quickly</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.camel.quarkus</groupId>
+                        <artifactId>camel-quarkus-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>update-extension-doc-page</id>
+                                <goals>
+                                    <goal>update-extension-doc-page</goal>
+                                </goals>
+                                <phase>process-classes</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
diff --git a/extensions-jvm/json-patch/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions-jvm/json-patch/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..b0364aa
--- /dev/null
+++ b/extensions-jvm/json-patch/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+#   mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel JsonPatch"
+description: "JsonPatch component which transform JSON using JSON patch (RFC 6902)"
+metadata:
+  unlisted: true
+  guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/json-patch.html"
+  categories:
+  - "integration"
+  status:
+  - "preview"
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index 70b7efe..077362d 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -87,6 +87,7 @@
         <module>jgroups-raft</module>
         <module>jooq</module>
         <module>joor</module>
+        <module>json-patch</module>
         <module>jsonapi</module>
         <module>jt400</module>
         <module>kamelet-reify</module>
diff --git a/integration-tests/json-patch/pom.xml b/integration-tests/json-patch/pom.xml
new file mode 100644
index 0000000..a39ab63
--- /dev/null
+++ b/integration-tests/json-patch/pom.xml
@@ -0,0 +1,103 @@
+<?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.0-SNAPSHOT</version>
+        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-json-patch</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: JsonPatch</name>
+    <description>Integration tests for Camel Quarkus JsonPatch extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>${quarkus.platform.group-id}</groupId>
+                <artifactId>${quarkus.platform.artifact-id}</artifactId>
+                <version>${quarkus.platform.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-test</artifactId>
+                <version>${camel-quarkus.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-json-patch</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</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>
+    </dependencies>
+
+    <profiles>
+        <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-json-patch-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/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java b/integration-tests/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
new file mode 100644
index 0000000..f2bff4f
--- /dev/null
+++ b/integration-tests/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.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.json.patch.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.jboss.logging.Logger;
+
+@Path("/json-patch")
+@ApplicationScoped
+public class JsonPatchResource {
+
+    private static final Logger LOG = Logger.getLogger(JsonPatchResource.class);
+
+    private static final String COMPONENT_JSON_PATCH = "json-patch";
+    @Inject
+    CamelContext context;
+
+    @Path("/load/component/json-patch")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentJsonPatch() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_JSON_PATCH) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_JSON_PATCH);
+        return Response.status(500, COMPONENT_JSON_PATCH + " could not be loaded from the Camel context").build();
+    }
+}
diff --git a/integration-tests/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java b/integration-tests/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
new file mode 100644
index 0000000..1b004e6
--- /dev/null
+++ b/integration-tests/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.json.patch.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+@QuarkusTest
+class JsonPatchTest {
+
+    @Test
+    public void loadComponentJsonPatch() {
+        /* A simple autogenerated test */
+        RestAssured.get("/json-patch/load/component/json-patch")
+                .then()
+                .statusCode(200);
+    }
+
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 436955f..08f2ae2 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -126,6 +126,7 @@
         <module>js-dsl</module>
         <module>jsch</module>
         <module>jslt</module>
+        <module>json-patch</module>
         <module>json-validator</module>
         <module>jsonata</module>
         <module>jsonpath</module>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 0916434..2be4808 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -1468,6 +1468,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
+                <artifactId>camel-json-patch</artifactId>
+                <version>${camel.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
                 <artifactId>camel-json-validator</artifactId>
                 <version>${camel.version}</version>
             </dependency>
@@ -4036,6 +4041,16 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-json-patch</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-json-patch-deployment</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-json-validator</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>

[camel-quarkus] 02/04: Added Json-Patch Extension

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

acosentino pushed a commit to branch json-patch-jvm-ext
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 71997425b43c02440fbb44279a757cba3c07de9f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 23 15:30:53 2021 +0100

    Added Json-Patch Extension
---
 catalog/pom.xml                                       | 13 +++++++++++++
 docs/modules/ROOT/nav.adoc                            |  1 +
 .../json-patch/pom.xml                                | 19 -------------------
 .../component/json/patch/it/JsonPatchResource.java    |  0
 .../component/json/patch/it/JsonPatchTest.java        |  0
 integration-tests-jvm/pom.xml                         |  1 +
 integration-tests/pom.xml                             |  1 -
 7 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/catalog/pom.xml b/catalog/pom.xml
index 40d6f4a..41b80fa 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -2198,6 +2198,19 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-json-patch</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-json-validator</artifactId>
             <version>${project.version}</version>
             <type>pom</type>
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 31b3a6f..b767ea5 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -188,6 +188,7 @@
 *** xref:reference/extensions/jing.adoc[Jing]
 *** xref:reference/extensions/jira.adoc[Jira]
 *** xref:reference/extensions/johnzon.adoc[Johnzon]
+*** xref:reference/extensions/json-patch.adoc[JsonPatch]
 *** xref:reference/extensions/kafka.adoc[Kafka]
 *** xref:reference/extensions/kamelet.adoc[Kamelet]
 *** xref:reference/extensions/kamelet-reify.adoc[Kamelet Reify]
diff --git a/integration-tests/json-patch/pom.xml b/integration-tests-jvm/json-patch/pom.xml
similarity index 82%
rename from integration-tests/json-patch/pom.xml
rename to integration-tests-jvm/json-patch/pom.xml
index a39ab63..a469710 100644
--- a/integration-tests/json-patch/pom.xml
+++ b/integration-tests-jvm/json-patch/pom.xml
@@ -32,25 +32,6 @@
     <name>Camel Quarkus :: Integration Tests :: JsonPatch</name>
     <description>Integration tests for Camel Quarkus JsonPatch extension</description>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>${quarkus.platform.group-id}</groupId>
-                <artifactId>${quarkus.platform.artifact-id}</artifactId>
-                <version>${quarkus.platform.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-bom-test</artifactId>
-                <version>${camel-quarkus.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java b/integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
similarity index 100%
rename from integration-tests/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
rename to integration-tests-jvm/json-patch/src/main/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchResource.java
diff --git a/integration-tests/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java b/integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
similarity index 100%
rename from integration-tests/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
rename to integration-tests-jvm/json-patch/src/test/java/org/apache/camel/quarkus/component/json/patch/it/JsonPatchTest.java
diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml
index e95792d..32adcf0 100644
--- a/integration-tests-jvm/pom.xml
+++ b/integration-tests-jvm/pom.xml
@@ -86,6 +86,7 @@
         <module>jooq</module>
         <module>joor</module>
         <module>jsonapi</module>
+        <module>json-patch</module>
         <module>jt400</module>
         <module>kamelet-reify</module>
         <module>kotlin-dsl</module>
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 08f2ae2..436955f 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -126,7 +126,6 @@
         <module>js-dsl</module>
         <module>jsch</module>
         <module>jslt</module>
-        <module>json-patch</module>
         <module>json-validator</module>
         <module>jsonata</module>
         <module>jsonpath</module>