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 <[email protected]> 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("[email protected]"); 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://[email protected]?amazonSESClient=#amazonSESClient&accessKey=xxx" - + "&secretKey=yyy&to=#toList&subject=Subject" - + "&[email protected]&replyToAddresses=#replyToList"); + + "&secretKey=yyy&[email protected],[email protected]&subject=Subject" + + "&[email protected]&[email protected],[email protected]"); assertEquals("[email protected]", 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, "[email protected]"); - exchange.getIn().setHeader(Ses2Constants.TO, Arrays.asList("[email protected]", "[email protected]")); + exchange.getIn().setHeader(Ses2Constants.TO, "[email protected], [email protected]"); exchange.getIn().setHeader(Ses2Constants.RETURN_PATH, "[email protected]"); exchange.getIn().setHeader(Ses2Constants.REPLY_TO_ADDRESSES, - Arrays.asList("[email protected]", "[email protected]")); + "[email protected], [email protected]"); 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("[email protected]", "[email protected]"); - - @BindToRegistry("replyToList") - private List<String> replyToList = Arrays.asList("[email protected]", "[email protected]"); - @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, "[email protected]"); - exchange.getIn().setHeader(Ses2Constants.TO, Arrays.asList("[email protected]", "[email protected]")); + exchange.getIn().setHeader(Ses2Constants.TO, "[email protected], [email protected]"); exchange.getIn().setHeader(Ses2Constants.RETURN_PATH, "[email protected]"); exchange.getIn().setHeader(Ses2Constants.REPLY_TO_ADDRESSES, - Arrays.asList("[email protected]", "[email protected]")); + "[email protected], [email protected]"); 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://[email protected]" + "?to=#toList" + "&subject=Subject" - + "&[email protected]" + "&replyToAddresses=#replyToList" - + "&amazonSESClient=#amazonSESClient"); + from("direct:start") + .to("aws2-ses://[email protected]" + "[email protected],[email protected]" + "&subject=Subject" + + "&[email protected]" + "&[email protected],[email protected]" + + "&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://[email protected]?amazonSESClient=#amazonSESClient&[email protected]"/> + <to uri="aws2-ses://[email protected]?amazonSESClient=#amazonSESClient&[email protected]&[email protected],[email protected]&[email protected],[email protected]"/> </route> </camelContext>
