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 2022/08/29 12:50:49 UTC

[camel-kamelets] branch main updated (01b92d79 -> 948a09dc)

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

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


    from 01b92d79 Added ReplaceField Test
     new fb9e5906 Indentation of tests and renaming
     new 1d444f6a ReplaceField tests: Added tests with enabled and disable parameters specified
     new fa8f2972 ReplaceField tests: Added tests with enabled and disable parameters specified
     new 27a2376d ReplaceField tests: Added tests with enabled and disable parameters specified
     new 948a09dc ReplaceField tests: Added tests with enabled and disable parameters specified

The 5 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:
 .../kamelets/utils/transform/ReplaceFieldTest.java | 58 +++++++++++++++++++++-
 1 file changed, 57 insertions(+), 1 deletion(-)


[camel-kamelets] 05/05: ReplaceField tests: Added tests with enabled and disable parameters specified

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

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

commit 948a09dcbddbf71076396dc29b36830634ac8a1c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 29 14:47:22 2022 +0200

    ReplaceField tests: Added tests with enabled and disable parameters specified
---
 .../camel/kamelets/utils/transform/ReplaceFieldTest.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
index 45910b2c..5a6e06e7 100644
--- a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
+++ b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
@@ -98,4 +98,18 @@ class ReplaceFieldTest {
                 "\"age\":\"29\"" +
                 "}");
     }
+
+    @Test
+    void shouldReplaceFieldWithDisableAllFields() throws Exception {
+        Exchange exchange = new DefaultExchange(camelContext);
+
+        exchange.getMessage().setBody(mapper.readTree(baseJson));
+
+        JsonNode node = processor.process("none", "all", "name:firstName", exchange);
+
+        Assertions.assertEquals(node.toString(), "{" +
+                "\"name\":\"Rajesh Koothrappali\"," +
+                "\"age\":\"29\"" +
+                "}");
+    }
 }


[camel-kamelets] 01/05: Indentation of tests and renaming

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

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

commit fb9e59061fa6081ec02754e8c7db73ab2e2b6157
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 29 14:40:54 2022 +0200

    Indentation of tests and renaming
---
 .../org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
index d1a311cb..b3e4e332 100644
--- a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
+++ b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
@@ -43,8 +43,9 @@ class ReplaceFieldTest {
         camelContext = new DefaultCamelContext();
         processor = new ReplaceField();
     }
+    
     @Test
-    void shouldAddFieldToPlainJson() throws Exception {
+    void shouldReplaceFieldToPlainJson() throws Exception {
         Exchange exchange = new DefaultExchange(camelContext);
 
         exchange.getMessage().setBody(mapper.readTree(baseJson));


[camel-kamelets] 04/05: ReplaceField tests: Added tests with enabled and disable parameters specified

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

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

commit 27a2376d8f3ebeabc3780b0bae53b08a1fc07bba
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 29 14:46:17 2022 +0200

    ReplaceField tests: Added tests with enabled and disable parameters specified
---
 .../camel/kamelets/utils/transform/ReplaceFieldTest.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
index 28087975..45910b2c 100644
--- a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
+++ b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
@@ -84,4 +84,18 @@ class ReplaceFieldTest {
                 "\"firstName\":\"Rajesh Koothrappali\"" +
                 "}");
     }
+
+    @Test
+    void shouldReplaceFieldWithSpecificDisableFields() throws Exception {
+        Exchange exchange = new DefaultExchange(camelContext);
+
+        exchange.getMessage().setBody(mapper.readTree(baseJson));
+
+        JsonNode node = processor.process("all", "name,age", "name:firstName", exchange);
+
+        Assertions.assertEquals(node.toString(), "{" +
+                "\"name\":\"Rajesh Koothrappali\"," +
+                "\"age\":\"29\"" +
+                "}");
+    }
 }


[camel-kamelets] 02/05: ReplaceField tests: Added tests with enabled and disable parameters specified

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

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

commit 1d444f6a12090ca27f20e1256afacd9992a15781
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 29 14:43:25 2022 +0200

    ReplaceField tests: Added tests with enabled and disable parameters specified
---
 .../camel/kamelets/utils/transform/ReplaceFieldTest.java | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
index b3e4e332..05365932 100644
--- a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
+++ b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
@@ -43,7 +43,7 @@ class ReplaceFieldTest {
         camelContext = new DefaultCamelContext();
         processor = new ReplaceField();
     }
-    
+
     @Test
     void shouldReplaceFieldToPlainJson() throws Exception {
         Exchange exchange = new DefaultExchange(camelContext);
@@ -57,4 +57,18 @@ class ReplaceFieldTest {
                         "\"years\":\"29\"" +
                         "}");
     }
+
+    @Test
+    void shouldReplaceFieldWithSpecificRename() throws Exception {
+        Exchange exchange = new DefaultExchange(camelContext);
+
+        exchange.getMessage().setBody(mapper.readTree(baseJson));
+
+        JsonNode node = processor.process("name,age", "none", "name:firstName", exchange);
+
+        Assertions.assertEquals(node.toString(), "{" +
+                "\"firstName\":\"Rajesh Koothrappali\"," +
+                "\"age\":\"29\"" +
+                "}");
+    }
 }


[camel-kamelets] 03/05: ReplaceField tests: Added tests with enabled and disable parameters specified

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

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

commit fa8f29724c080f6794fb387c3f201c155972064f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 29 14:44:29 2022 +0200

    ReplaceField tests: Added tests with enabled and disable parameters specified
---
 .../camel/kamelets/utils/transform/ReplaceFieldTest.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
index 05365932..28087975 100644
--- a/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
+++ b/library/camel-kamelets-utils/src/test/java/org/apache/camel/kamelets/utils/transform/ReplaceFieldTest.java
@@ -71,4 +71,17 @@ class ReplaceFieldTest {
                 "\"age\":\"29\"" +
                 "}");
     }
+
+    @Test
+    void shouldReplaceFieldWithSpecificRenameAndDisableFields() throws Exception {
+        Exchange exchange = new DefaultExchange(camelContext);
+
+        exchange.getMessage().setBody(mapper.readTree(baseJson));
+
+        JsonNode node = processor.process("name", "none", "name:firstName", exchange);
+
+        Assertions.assertEquals(node.toString(), "{" +
+                "\"firstName\":\"Rajesh Koothrappali\"" +
+                "}");
+    }
 }