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:48:44 UTC

[camel-kamelets] branch more-replace-field-tests created (now 00b70fd7)

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

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


      at 00b70fd7 ReplaceField tests: Added tests with enabled and disable parameters specified

This branch includes the following new commits:

     new 53272e4f Indentation of tests and renaming
     new 63324b8b ReplaceField tests: Added tests with enabled and disable parameters specified
     new 63acfb02 ReplaceField tests: Added tests with enabled and disable parameters specified
     new 37447bad ReplaceField tests: Added tests with enabled and disable parameters specified
     new 00b70fd7 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.



[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 more-replace-field-tests
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 00b70fd756cf0c799740dfca3ba316c00a518439
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] 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 more-replace-field-tests
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 37447bad1e96d06a174423918c69df441e98ca57
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] 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 more-replace-field-tests
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 63acfb02fb52ce1b976ddfff14524c906ac7531f
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\"" +
+                "}");
+    }
 }


[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 more-replace-field-tests
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 63324b8b1c7e75e3b9a03e4c22ba66511689b60b
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] 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 more-replace-field-tests
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 53272e4ff8462d26cb02300093a75d90772ca3e3
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));