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

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


The following commit(s) were added to refs/heads/main by this push:
     new 25b8fd5  Assert that Component DSL and Endpoint DSL work for AtlasMap
25b8fd5 is described below

commit 25b8fd5b2dd173c8cd44a147141793af9cdb15b3
Author: Peter Palaga <ppal...@redhat.com>
AuthorDate: Mon Nov 1 11:18:19 2021 +0100

    Assert that Component DSL and Endpoint DSL work for AtlasMap
---
 .../it/{Route.java => AtlasmapComponentDsl.java}   | 25 +++++++++++-----------
 .../camel/quarkus/component/atlasmap/it/Route.java |  6 +++---
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git 
a/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
 
b/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/AtlasmapComponentDsl.java
similarity index 55%
copy from 
integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
copy to 
integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/AtlasmapComponentDsl.java
index d6a5dbd..12eddb4 100644
--- 
a/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
+++ 
b/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/AtlasmapComponentDsl.java
@@ -16,20 +16,19 @@
  */
 package org.apache.camel.quarkus.component.atlasmap.it;
 
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.quarkus.component.atlasmap.it.model.Account;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import javax.inject.Singleton;
 
-public class Route extends RouteBuilder {
-    @Override
-    public void configure() throws Exception {
+import org.apache.camel.builder.component.ComponentsBuilderFactory;
+import org.apache.camel.component.atlasmap.AtlasMapComponent;
 
-        // example of Routes that need the class Account to be registred for 
reflection
-        from("platform-http:/atlasmap/json/java2csv?httpMethodRestrict=POST")
-                .unmarshal().json(Account.class)
-                .to("atlasmap:mapping/json/atlasmapping-java-to-csv.json");
-
-        from("platform-http:/atlasmap/json/csv2java?httpMethodRestrict=POST")
-                .to("atlasmap:mapping/json/atlasmapping-csv-to-java.json")
-                .marshal().json(Account.class);
+@ApplicationScoped
+public class AtlasmapComponentDsl {
+    @Singleton
+    @Named
+    AtlasMapComponent atlasmap() {
+        /* Make sure that Component DSL works for Atlasmap */
+        return ComponentsBuilderFactory.atlasmap().build();
     }
 }
diff --git 
a/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
 
b/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
index d6a5dbd..0edb7c0 100644
--- 
a/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
+++ 
b/integration-tests/atlasmap/src/main/java/org/apache/camel/quarkus/component/atlasmap/it/Route.java
@@ -16,17 +16,17 @@
  */
 package org.apache.camel.quarkus.component.atlasmap.it;
 
-import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
 import org.apache.camel.quarkus.component.atlasmap.it.model.Account;
 
-public class Route extends RouteBuilder {
+public class Route extends EndpointRouteBuilder {
     @Override
     public void configure() throws Exception {
 
         // example of Routes that need the class Account to be registred for 
reflection
         from("platform-http:/atlasmap/json/java2csv?httpMethodRestrict=POST")
                 .unmarshal().json(Account.class)
-                .to("atlasmap:mapping/json/atlasmapping-java-to-csv.json");
+                .to(atlasmap("mapping/json/atlasmapping-java-to-csv.json"));
 
         from("platform-http:/atlasmap/json/csv2java?httpMethodRestrict=POST")
                 .to("atlasmap:mapping/json/atlasmapping-csv-to-java.json")

Reply via email to