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:37 UTC
[camel] 04/06: CAMEL-17291 - Camel-AWS2-SES: Don't set the replyTo/to addresses as List
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&returnPath=bounce@example.com"/>
+ <to uri="aws2-ses://from@example.com?amazonSESClient=#amazonSESClient&returnPath=bounce@example.com&to=to1@example.com,to2@example.com&replyToAddresses=replyTo1@example.com,replyTo2@example.com"/>
</route>
</camelContext>