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/09 13:18:33 UTC

[camel] branch main updated (ef396a2 -> 3a02d43)

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.git.


    from ef396a2  Sync deps
     new 96c6b56  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
     new 873be40  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
     new e109381  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
     new b772d5f  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
     new eee5ceb  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
     new 3a02d43  CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

The 6 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:
 .../apache/camel/catalog/components/aws2-ses.json  |  8 ++--
 .../aws2/ses/Ses2ComponentConfigurer.java          | 18 ++------
 .../component/aws2/ses/Ses2EndpointConfigurer.java | 18 ++------
 .../apache/camel/component/aws2/ses/aws2-ses.json  |  8 ++--
 .../component/aws2/ses/Ses2Configuration.java      | 29 ++++---------
 .../camel/component/aws2/ses/Ses2Producer.java     | 33 +++++++++++----
 .../aws2/ses/SesComponentConfigurationTest.java    |  8 +---
 .../component/aws2/ses/SesComponentSpringTest.java |  5 +--
 .../camel/component/aws2/ses/SesComponentTest.java | 18 +++-----
 .../aws2/ses/integration/SesComponentManualIT.java |  4 +-
 .../aws2/ses/SESComponentSpringTest-context.xml    |  2 +-
 .../dsl/Aws2SesComponentBuilderFactory.java        | 22 +++++-----
 .../endpoint/dsl/Ses2EndpointBuilderFactory.java   | 48 +++-------------------
 13 files changed, 78 insertions(+), 143 deletions(-)

[camel] 02/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit 873be40342a31f2b4883a2468f637ecd26711b17
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 13:45:48 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../aws2/ses/Ses2ComponentConfigurer.java          | 18 ++------
 .../component/aws2/ses/Ses2EndpointConfigurer.java | 18 ++------
 .../apache/camel/component/aws2/ses/aws2-ses.json  |  8 ++--
 .../dsl/Aws2SesComponentBuilderFactory.java        | 22 +++++-----
 .../endpoint/dsl/Ses2EndpointBuilderFactory.java   | 48 +++-------------------
 5 files changed, 28 insertions(+), 86 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2ComponentConfigurer.java b/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2ComponentConfigurer.java
index 624335c..a0fbf49 100644
--- a/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2ComponentConfigurer.java
+++ b/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2ComponentConfigurer.java
@@ -47,13 +47,13 @@ public class Ses2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
         case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "replytoaddresses":
-        case "replyToAddresses": getOrCreateConfiguration(target).setReplyToAddresses(property(camelContext, java.util.List.class, value)); return true;
+        case "replyToAddresses": getOrCreateConfiguration(target).setReplyToAddresses(property(camelContext, java.lang.String.class, value)); return true;
         case "returnpath":
         case "returnPath": getOrCreateConfiguration(target).setReturnPath(property(camelContext, java.lang.String.class, value)); return true;
         case "secretkey":
         case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "subject": getOrCreateConfiguration(target).setSubject(property(camelContext, java.lang.String.class, value)); return true;
-        case "to": getOrCreateConfiguration(target).setTo(property(camelContext, java.util.List.class, value)); return true;
+        case "to": getOrCreateConfiguration(target).setTo(property(camelContext, java.lang.String.class, value)); return true;
         case "trustallcertificates":
         case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
         case "uriendpointoverride":
@@ -91,13 +91,13 @@ public class Ses2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "proxyProtocol": return software.amazon.awssdk.core.Protocol.class;
         case "region": return java.lang.String.class;
         case "replytoaddresses":
-        case "replyToAddresses": return java.util.List.class;
+        case "replyToAddresses": return java.lang.String.class;
         case "returnpath":
         case "returnPath": return java.lang.String.class;
         case "secretkey":
         case "secretKey": return java.lang.String.class;
         case "subject": return java.lang.String.class;
-        case "to": return java.util.List.class;
+        case "to": return java.lang.String.class;
         case "trustallcertificates":
         case "trustAllCertificates": return boolean.class;
         case "uriendpointoverride":
@@ -147,15 +147,5 @@ public class Ses2ComponentConfigurer extends PropertyConfigurerSupport implement
         default: return null;
         }
     }
-
-    @Override
-    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "replytoaddresses":
-        case "replyToAddresses": return java.lang.String.class;
-        case "to": return java.lang.String.class;
-        default: return null;
-        }
-    }
 }
 
diff --git a/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2EndpointConfigurer.java b/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2EndpointConfigurer.java
index e608abb..7f35fbe 100644
--- a/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2EndpointConfigurer.java
+++ b/components/camel-aws/camel-aws2-ses/src/generated/java/org/apache/camel/component/aws2/ses/Ses2EndpointConfigurer.java
@@ -37,13 +37,13 @@ public class Ses2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyProtocol": target.getConfiguration().setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
         case "region": target.getConfiguration().setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "replytoaddresses":
-        case "replyToAddresses": target.getConfiguration().setReplyToAddresses(property(camelContext, java.util.List.class, value)); return true;
+        case "replyToAddresses": target.getConfiguration().setReplyToAddresses(property(camelContext, java.lang.String.class, value)); return true;
         case "returnpath":
         case "returnPath": target.getConfiguration().setReturnPath(property(camelContext, java.lang.String.class, value)); return true;
         case "secretkey":
         case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "subject": target.getConfiguration().setSubject(property(camelContext, java.lang.String.class, value)); return true;
-        case "to": target.getConfiguration().setTo(property(camelContext, java.util.List.class, value)); return true;
+        case "to": target.getConfiguration().setTo(property(camelContext, java.lang.String.class, value)); return true;
         case "trustallcertificates":
         case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
         case "uriendpointoverride":
@@ -78,13 +78,13 @@ public class Ses2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyProtocol": return software.amazon.awssdk.core.Protocol.class;
         case "region": return java.lang.String.class;
         case "replytoaddresses":
-        case "replyToAddresses": return java.util.List.class;
+        case "replyToAddresses": return java.lang.String.class;
         case "returnpath":
         case "returnPath": return java.lang.String.class;
         case "secretkey":
         case "secretKey": return java.lang.String.class;
         case "subject": return java.lang.String.class;
-        case "to": return java.util.List.class;
+        case "to": return java.lang.String.class;
         case "trustallcertificates":
         case "trustAllCertificates": return boolean.class;
         case "uriendpointoverride":
@@ -131,15 +131,5 @@ public class Ses2EndpointConfigurer extends PropertyConfigurerSupport implements
         default: return null;
         }
     }
-
-    @Override
-    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "replytoaddresses":
-        case "replyToAddresses": return java.lang.String.class;
-        case "to": return java.lang.String.class;
-        default: return null;
-        }
-    }
 }
 
diff --git a/components/camel-aws/camel-aws2-ses/src/generated/resources/org/apache/camel/component/aws2/ses/aws2-ses.json b/components/camel-aws/camel-aws2-ses/src/generated/resources/org/apache/camel/component/aws2/ses/aws2-ses.json
index 4538417..b569536 100644
--- a/components/camel-aws/camel-aws2-ses/src/generated/resources/org/apache/camel/component/aws2/ses/aws2-ses.json
+++ b/components/camel-aws/camel-aws2-ses/src/generated/resources/org/apache/camel/component/aws2/ses/aws2-ses.json
@@ -30,10 +30,10 @@
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the SES client" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating t [...]
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region  [...]
-    "replyToAddresses": { "kind": "property", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' [...]
+    "replyToAddresses": { "kind": "property", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses [...]
     "returnPath": { "kind": "property", "displayName": "Return Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header." },
     "subject": { "kind": "property", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSesSubject' is not present." },
-    "to": { "kind": "property", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of destination email address. Can be overriden with 'CamelAwsSesTo' header." },
+    "to": { "kind": "property", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated destination email address. Can be overriden with 'CamelAwsSesTo' header." },
     "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set whether the Ses client should expect to load credentials through a d [...]
@@ -50,10 +50,10 @@
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the SES client" },
     "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating  [...]
     "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region [...]
-    "replyToAddresses": { "kind": "parameter", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses [...]
+    "replyToAddresses": { "kind": "parameter", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresse [...]
     "returnPath": { "kind": "parameter", "displayName": "Return Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header." },
     "subject": { "kind": "parameter", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSesSubject' is not present." },
-    "to": { "kind": "parameter", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of destination email address. Can be overriden with 'CamelAwsSesTo' header." },
+    "to": { "kind": "parameter", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated destination email address. Can be overriden with 'CamelAwsSesTo' header." },
     "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set whether the Ses client should expect to load credentials through a  [...]
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SesComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SesComponentBuilderFactory.java
index d27c826..c69f7e0 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SesComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SesComponentBuilderFactory.java
@@ -184,11 +184,10 @@ public interface Aws2SesComponentBuilderFactory {
             return this;
         }
         /**
-         * List of reply-to email address(es) for the message, override it using
-         * 'CamelAwsSesReplyToAddresses' header.
+         * List of comma separated reply-to email address(es) for the message,
+         * override it using 'CamelAwsSesReplyToAddresses' header.
          * 
-         * The option is a:
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: producer
          * 
@@ -196,7 +195,7 @@ public interface Aws2SesComponentBuilderFactory {
          * @return the dsl builder
          */
         default Aws2SesComponentBuilder replyToAddresses(
-                java.util.List<java.lang.String> replyToAddresses) {
+                java.lang.String replyToAddresses) {
             doSetProperty("replyToAddresses", replyToAddresses);
             return this;
         }
@@ -231,18 +230,17 @@ public interface Aws2SesComponentBuilderFactory {
             return this;
         }
         /**
-         * List of destination email address. Can be overriden with
-         * 'CamelAwsSesTo' header.
+         * List of comma separated destination email address. Can be overriden
+         * with 'CamelAwsSesTo' header.
          * 
-         * The option is a:
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: producer
          * 
          * @param to the value to set
          * @return the dsl builder
          */
-        default Aws2SesComponentBuilder to(java.util.List<java.lang.String> to) {
+        default Aws2SesComponentBuilder to(java.lang.String to) {
             doSetProperty("to", to);
             return this;
         }
@@ -378,10 +376,10 @@ public interface Aws2SesComponentBuilderFactory {
             case "proxyPort": getOrCreateConfiguration((Ses2Component) component).setProxyPort((java.lang.Integer) value); return true;
             case "proxyProtocol": getOrCreateConfiguration((Ses2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true;
             case "region": getOrCreateConfiguration((Ses2Component) component).setRegion((java.lang.String) value); return true;
-            case "replyToAddresses": getOrCreateConfiguration((Ses2Component) component).setReplyToAddresses((java.util.List) value); return true;
+            case "replyToAddresses": getOrCreateConfiguration((Ses2Component) component).setReplyToAddresses((java.lang.String) value); return true;
             case "returnPath": getOrCreateConfiguration((Ses2Component) component).setReturnPath((java.lang.String) value); return true;
             case "subject": getOrCreateConfiguration((Ses2Component) component).setSubject((java.lang.String) value); return true;
-            case "to": getOrCreateConfiguration((Ses2Component) component).setTo((java.util.List) value); return true;
+            case "to": getOrCreateConfiguration((Ses2Component) component).setTo((java.lang.String) value); return true;
             case "trustAllCertificates": getOrCreateConfiguration((Ses2Component) component).setTrustAllCertificates((boolean) value); return true;
             case "uriEndpointOverride": getOrCreateConfiguration((Ses2Component) component).setUriEndpointOverride((java.lang.String) value); return true;
             case "useDefaultCredentialsProvider": getOrCreateConfiguration((Ses2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ses2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ses2EndpointBuilderFactory.java
index a32b6b0..23088d8 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ses2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ses2EndpointBuilderFactory.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.builder.endpoint.dsl;
 
-import java.util.List;
 import javax.annotation.Generated;
 import org.apache.camel.builder.EndpointConsumerBuilder;
 import org.apache.camel.builder.EndpointProducerBuilder;
@@ -238,28 +237,10 @@ public interface Ses2EndpointBuilderFactory {
             return this;
         }
         /**
-         * List of reply-to email address(es) for the message, override it using
-         * 'CamelAwsSesReplyToAddresses' header.
+         * List of comma separated reply-to email address(es) for the message,
+         * override it using 'CamelAwsSesReplyToAddresses' header.
          * 
-         * The option is a:
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
-         * 
-         * Group: producer
-         * 
-         * @param replyToAddresses the value to set
-         * @return the dsl builder
-         */
-        default Ses2EndpointBuilder replyToAddresses(
-                List<String> replyToAddresses) {
-            doSetProperty("replyToAddresses", replyToAddresses);
-            return this;
-        }
-        /**
-         * List of reply-to email address(es) for the message, override it using
-         * 'CamelAwsSesReplyToAddresses' header.
-         * 
-         * The option will be converted to a
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: producer
          * 
@@ -301,27 +282,10 @@ public interface Ses2EndpointBuilderFactory {
             return this;
         }
         /**
-         * List of destination email address. Can be overriden with
-         * 'CamelAwsSesTo' header.
+         * List of comma separated destination email address. Can be overriden
+         * with 'CamelAwsSesTo' header.
          * 
-         * The option is a:
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
-         * 
-         * Group: producer
-         * 
-         * @param to the value to set
-         * @return the dsl builder
-         */
-        default Ses2EndpointBuilder to(List<String> to) {
-            doSetProperty("to", to);
-            return this;
-        }
-        /**
-         * List of destination email address. Can be overriden with
-         * 'CamelAwsSesTo' header.
-         * 
-         * The option will be converted to a
-         * &lt;code&gt;java.util.List&amp;lt;java.lang.String&amp;gt;&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: producer
          * 

[camel] 03/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit e109381127bd0d75fe771ac652afd207eb77922e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 13:47:10 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../apache/camel/component/aws2/ses/SesComponentConfigurationTest.java  | 2 --
 1 file changed, 2 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
index 6229815..81402af 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
@@ -113,12 +113,10 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
         assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
         assertEquals("yyy", endpoint.getConfiguration().getSecretKey());
         assertNotNull(endpoint.getConfiguration().getAmazonSESClient());
-        assertEquals(2, endpoint.getConfiguration().getTo().size());
         assertTrue(endpoint.getConfiguration().getTo().contains("to1@example.com"));
         assertTrue(endpoint.getConfiguration().getTo().contains("to2@example.com"));
         assertEquals("Subject", endpoint.getConfiguration().getSubject());
         assertEquals("bounce@example.com", endpoint.getConfiguration().getReturnPath());
-        assertEquals(2, endpoint.getConfiguration().getReplyToAddresses().size());
         assertTrue(endpoint.getConfiguration().getReplyToAddresses().contains("replyTo1@example.com"));
         assertTrue(endpoint.getConfiguration().getReplyToAddresses().contains("replyTo2@example.com"));
     }

[camel] 05/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit eee5ceb1dd36854cd134107309ec66f2ead821a6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 14:12:05 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../camel/component/aws2/ses/Ses2Producer.java     | 22 ++++++++++++++++------
 .../aws2/ses/integration/SesComponentManualIT.java |  4 +---
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
index aedf021..9cbca41 100644
--- a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
+++ b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
@@ -20,6 +20,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -28,6 +29,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -128,9 +130,13 @@ public class Ses2Producer extends DefaultProducer {
         if (replyToAddresses == null) {
             replyToAddresses = getConfiguration().getReplyToAddresses();
         }
-        return Stream.of(replyToAddresses.split(","))
-                .map(String::trim)
-                .collect(Collectors.toList());
+        if (ObjectHelper.isNotEmpty(replyToAddresses)) {
+            return Stream.of(replyToAddresses.split(","))
+                    .map(String::trim)
+                    .collect(Collectors.toList());
+        } else {
+            return Collections.emptyList();
+        }
     }
 
     private String determineReturnPath(Exchange exchange) {
@@ -157,9 +163,13 @@ public class Ses2Producer extends DefaultProducer {
         if (to == null) {
             to = getConfiguration().getTo();
         }
-        return Stream.of(to.split(","))
-                .map(String::trim)
-                .collect(Collectors.toList());
+        if (ObjectHelper.isNotEmpty(to)) {
+            return Stream.of(to.split(","))
+                    .map(String::trim)
+                    .collect(Collectors.toList());
+        } else {
+            return Collections.emptyList();
+        }
     }
 
     private String determineFrom(Exchange exchange) {
diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentManualIT.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentManualIT.java
index 0c2b700..78f139b 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentManualIT.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentManualIT.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.aws2.ses.integration;
 
-import java.util.Collections;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
@@ -42,7 +40,7 @@ public class SesComponentManualIT extends CamelTestSupport {
         Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor() {
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setHeader(Ses2Constants.SUBJECT, "This is my subject");
-                exchange.getIn().setHeader(Ses2Constants.TO, Collections.singletonList("to@example.com"));
+                exchange.getIn().setHeader(Ses2Constants.TO, "to@example.com");
                 exchange.getIn().setBody("This is my message text.");
             }
         });

[camel] 06/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit 3a02d4305f80b4a1739af43c923530f541362e23
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 14:17:50 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../resources/org/apache/camel/catalog/components/aws2-ses.json   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ses.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ses.json
index 4538417..b569536 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ses.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ses.json
@@ -30,10 +30,10 @@
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the SES client" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating t [...]
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region  [...]
-    "replyToAddresses": { "kind": "property", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' [...]
+    "replyToAddresses": { "kind": "property", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses [...]
     "returnPath": { "kind": "property", "displayName": "Return Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header." },
     "subject": { "kind": "property", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSesSubject' is not present." },
-    "to": { "kind": "property", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of destination email address. Can be overriden with 'CamelAwsSesTo' header." },
+    "to": { "kind": "property", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated destination email address. Can be overriden with 'CamelAwsSesTo' header." },
     "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set whether the Ses client should expect to load credentials through a d [...]
@@ -50,10 +50,10 @@
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the SES client" },
     "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating  [...]
     "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region [...]
-    "replyToAddresses": { "kind": "parameter", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses [...]
+    "replyToAddresses": { "kind": "parameter", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresse [...]
     "returnPath": { "kind": "parameter", "displayName": "Return Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header." },
     "subject": { "kind": "parameter", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSesSubject' is not present." },
-    "to": { "kind": "parameter", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of destination email address. Can be overriden with 'CamelAwsSesTo' header." },
+    "to": { "kind": "parameter", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "List of comma separated destination email address. Can be overriden with 'CamelAwsSesTo' header." },
     "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ses.Ses2Configuration", "configurationField": "configuration", "description": "Set whether the Ses client should expect to load credentials through a  [...]

[camel] 01/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit 96c6b568eaf84be80d4833f6a7f4a73f33dc63d1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 13:45:09 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../component/aws2/ses/Ses2Configuration.java      | 29 +++++++---------------
 .../camel/component/aws2/ses/Ses2Producer.java     | 23 +++++++++++------
 2 files changed, 24 insertions(+), 28 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Configuration.java b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Configuration.java
index a5519d7..376e702 100644
--- a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Configuration.java
+++ b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Configuration.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.aws2.ses;
 
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.RuntimeCamelException;
@@ -43,11 +42,11 @@ public class Ses2Configuration implements Cloneable {
     @UriParam
     private String subject;
     @UriParam
-    private List<String> to;
+    private String to;
     @UriParam
     private String returnPath;
     @UriParam
-    private List<String> replyToAddresses;
+    private String replyToAddresses;
     @UriParam(enums = "HTTP,HTTPS", defaultValue = "HTTPS")
     private Protocol proxyProtocol = Protocol.HTTPS;
     @UriParam
@@ -98,22 +97,15 @@ public class Ses2Configuration implements Cloneable {
         this.from = from;
     }
 
-    public List<String> getTo() {
+    public String getTo() {
         return to;
     }
 
     /**
-     * List of destination email address. Can be overriden with 'CamelAwsSesTo' header.
-     */
-    public void setTo(List<String> to) {
-        this.to = to;
-    }
-
-    /**
-     * List of destination email address. Can be overriden with 'CamelAwsSesTo' header.
+     * List of comma separated destination email address. Can be overriden with 'CamelAwsSesTo' header.
      */
     public void setTo(String to) {
-        this.to = Arrays.asList(to.split(","));
+        this.to = to;
     }
 
     public String getSecretKey() {
@@ -150,19 +142,16 @@ public class Ses2Configuration implements Cloneable {
         this.returnPath = returnPath;
     }
 
-    public List<String> getReplyToAddresses() {
+    public String getReplyToAddresses() {
         return replyToAddresses;
     }
 
     /**
-     * List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header.
+     * List of comma separated reply-to email address(es) for the message, override it using
+     * 'CamelAwsSesReplyToAddresses' header.
      */
-    public void setReplyToAddresses(List<String> replyToAddresses) {
-        this.replyToAddresses = replyToAddresses;
-    }
-
     public void setReplyToAddresses(String replyToAddresses) {
-        this.replyToAddresses = Arrays.asList(replyToAddresses.split(","));
+        this.replyToAddresses = replyToAddresses;
     }
 
     public Protocol getProxyProtocol() {
diff --git a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
index de68af4..aedf021 100644
--- a/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
+++ b/components/camel-aws/camel-aws2-ses/src/main/java/org/apache/camel/component/aws2/ses/Ses2Producer.java
@@ -21,6 +21,8 @@ import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
@@ -122,11 +124,13 @@ public class Ses2Producer extends DefaultProducer {
 
     @SuppressWarnings("unchecked")
     private Collection<String> determineReplyToAddresses(Exchange exchange) {
-        List<String> replyToAddresses = exchange.getIn().getHeader(Ses2Constants.REPLY_TO_ADDRESSES, List.class);
+        String replyToAddresses = exchange.getIn().getHeader(Ses2Constants.REPLY_TO_ADDRESSES, String.class);
         if (replyToAddresses == null) {
             replyToAddresses = getConfiguration().getReplyToAddresses();
         }
-        return replyToAddresses;
+        return Stream.of(replyToAddresses.split(","))
+                .map(String::trim)
+                .collect(Collectors.toList());
     }
 
     private String determineReturnPath(Exchange exchange) {
@@ -137,22 +141,25 @@ public class Ses2Producer extends DefaultProducer {
         return returnPath;
     }
 
-    @SuppressWarnings("unchecked")
     private Destination determineTo(Exchange exchange) {
-        List<String> to = exchange.getIn().getHeader(Ses2Constants.TO, List.class);
+        String to = exchange.getIn().getHeader(Ses2Constants.TO, String.class);
         if (to == null) {
             to = getConfiguration().getTo();
         }
-        return Destination.builder().toAddresses(to).build();
+        List<String> destinations = Stream.of(to.split(","))
+                .map(String::trim)
+                .collect(Collectors.toList());
+        return Destination.builder().toAddresses(destinations).build();
     }
 
-    @SuppressWarnings("unchecked")
     private List<String> determineRawTo(Exchange exchange) {
-        List<String> to = exchange.getIn().getHeader(Ses2Constants.TO, List.class);
+        String to = exchange.getIn().getHeader(Ses2Constants.TO, String.class);
         if (to == null) {
             to = getConfiguration().getTo();
         }
-        return to;
+        return Stream.of(to.split(","))
+                .map(String::trim)
+                .collect(Collectors.toList());
     }
 
     private String determineFrom(Exchange exchange) {

[camel] 04/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List

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.git

commit b772d5f439fe4167ff710e4088cf7f197cd823b8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 9 13:59:39 2021 +0100

    CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
---
 .../aws2/ses/SesComponentConfigurationTest.java        |  6 ++----
 .../component/aws2/ses/SesComponentSpringTest.java     |  5 ++---
 .../camel/component/aws2/ses/SesComponentTest.java     | 18 ++++++------------
 .../aws2/ses/SESComponentSpringTest-context.xml        |  2 +-
 4 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
index 81402af..d298d40 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
@@ -101,13 +101,11 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
         replyAddress.add("replyTo2@example.com");
 
         context.getRegistry().bind("amazonSESClient", mock);
-        context.getRegistry().bind("toList", to);
-        context.getRegistry().bind("replyToList", replyAddress);
         Ses2Component component = context.getComponent("aws2-ses", Ses2Component.class);
         Ses2Endpoint endpoint = (Ses2Endpoint) component
                 .createEndpoint("aws2-ses://from@example.com?amazonSESClient=#amazonSESClient&accessKey=xxx"
-                                + "&secretKey=yyy&to=#toList&subject=Subject"
-                                + "&returnPath=bounce@example.com&replyToAddresses=#replyToList");
+                                + "&secretKey=yyy&to=to1@example.com,to2@example.com&subject=Subject"
+                                + "&returnPath=bounce@example.com&replyToAddresses=replyTo1@example.com,replyTo2@example.com");
 
         assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
         assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
index d509315..a46af63 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.aws2.ses;
 
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.Exchange;
@@ -95,10 +94,10 @@ public class SesComponentSpringTest extends CamelSpringTestSupport {
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setBody("This is my message text.");
                 exchange.getIn().setHeader(Ses2Constants.FROM, "anotherFrom@example.com");
-                exchange.getIn().setHeader(Ses2Constants.TO, Arrays.asList("anotherTo1@example.com", "anotherTo2@example.com"));
+                exchange.getIn().setHeader(Ses2Constants.TO, "anotherTo1@example.com, anotherTo2@example.com");
                 exchange.getIn().setHeader(Ses2Constants.RETURN_PATH, "anotherBounce@example.com");
                 exchange.getIn().setHeader(Ses2Constants.REPLY_TO_ADDRESSES,
-                        Arrays.asList("anotherReplyTo1@example.com", "anotherReplyTo2@example.com"));
+                        "anotherReplyTo1@example.com, anotherReplyTo2@example.com");
                 exchange.getIn().setHeader(Ses2Constants.SUBJECT, "anotherSubject");
             }
         });
diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
index 0fe0886..3d04d9c 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.aws2.ses;
 
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.camel.BindToRegistry;
@@ -35,12 +34,6 @@ public class SesComponentTest extends CamelTestSupport {
     @BindToRegistry("amazonSESClient")
     private AmazonSESClientMock sesClient = new AmazonSESClientMock();
 
-    @BindToRegistry("toList")
-    private List<String> toList = Arrays.asList("to1@example.com", "to2@example.com");
-
-    @BindToRegistry("replyToList")
-    private List<String> replyToList = Arrays.asList("replyTo1@example.com", "replyTo2@example.com");
-
     @Test
     public void sendInOnlyMessageUsingUrlOptions() throws Exception {
         Exchange exchange = template.send("direct:start", new Processor() {
@@ -83,10 +76,10 @@ public class SesComponentTest extends CamelTestSupport {
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setBody("This is my message text.");
                 exchange.getIn().setHeader(Ses2Constants.FROM, "anotherFrom@example.com");
-                exchange.getIn().setHeader(Ses2Constants.TO, Arrays.asList("anotherTo1@example.com", "anotherTo2@example.com"));
+                exchange.getIn().setHeader(Ses2Constants.TO, "anotherTo1@example.com, anotherTo2@example.com");
                 exchange.getIn().setHeader(Ses2Constants.RETURN_PATH, "anotherBounce@example.com");
                 exchange.getIn().setHeader(Ses2Constants.REPLY_TO_ADDRESSES,
-                        Arrays.asList("anotherReplyTo1@example.com", "anotherReplyTo2@example.com"));
+                        "anotherReplyTo1@example.com, anotherReplyTo2@example.com");
                 exchange.getIn().setHeader(Ses2Constants.SUBJECT, "anotherSubject");
             }
         });
@@ -111,9 +104,10 @@ public class SesComponentTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("aws2-ses://from@example.com" + "?to=#toList" + "&subject=Subject"
-                                        + "&returnPath=bounce@example.com" + "&replyToAddresses=#replyToList"
-                                        + "&amazonSESClient=#amazonSESClient");
+                from("direct:start")
+                        .to("aws2-ses://from@example.com" + "?to=to1@example.com,to2@example.com" + "&subject=Subject"
+                            + "&returnPath=bounce@example.com" + "&replyToAddresses=replyTo1@example.com,replyTo2@example.com"
+                            + "&amazonSESClient=#amazonSESClient");
             }
         };
     }
diff --git a/components/camel-aws/camel-aws2-ses/src/test/resources/org/apache/camel/component/aws2/ses/SESComponentSpringTest-context.xml b/components/camel-aws/camel-aws2-ses/src/test/resources/org/apache/camel/component/aws2/ses/SESComponentSpringTest-context.xml
index 6fc8109..9e8cef1 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/resources/org/apache/camel/component/aws2/ses/SESComponentSpringTest-context.xml
+++ b/components/camel-aws/camel-aws2-ses/src/test/resources/org/apache/camel/component/aws2/ses/SESComponentSpringTest-context.xml
@@ -26,7 +26,7 @@
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <to uri="aws2-ses://from@example.com?amazonSESClient=#amazonSESClient&amp;returnPath=bounce@example.com"/>
+            <to uri="aws2-ses://from@example.com?amazonSESClient=#amazonSESClient&amp;returnPath=bounce@example.com&amp;to=to1@example.com,to2@example.com&amp;replyToAddresses=replyTo1@example.com,replyTo2@example.com"/>
         </route>
     </camelContext>