Repository: nifi
Updated Branches:
  refs/heads/master 246c09052 -> 768bcfb50


NIFI-5635 - Description PutEmail properties with multiple senders/recipients

This closes #3031

Signed-off-by: Mike Moser <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/768bcfb5
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/768bcfb5
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/768bcfb5

Branch: refs/heads/master
Commit: 768bcfb5092fb240adbe528103c06d7796a709bc
Parents: 246c090
Author: Pierre Villard <[email protected]>
Authored: Tue Sep 25 22:53:28 2018 +0200
Committer: Mike Moser <[email protected]>
Committed: Sun Oct 7 17:21:01 2018 -0400

----------------------------------------------------------------------
 .../org/apache/nifi/processors/standard/PutEmail.java | 12 ++++++++----
 .../apache/nifi/processors/standard/TestPutEmail.java | 14 ++++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/768bcfb5/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
index 8fdcc14..b7b8232 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java
@@ -165,28 +165,32 @@ public class PutEmail extends AbstractProcessor {
             .build();
     public static final PropertyDescriptor FROM = new 
PropertyDescriptor.Builder()
             .name("From")
-            .description("Specifies the Email address to use as the sender")
+            .description("Specifies the Email address to use as the sender. "
+                    + "Comma separated sequence of addresses following RFC822 
syntax.")
             .required(true)
             
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
     public static final PropertyDescriptor TO = new 
PropertyDescriptor.Builder()
             .name("To")
-            .description("The recipients to include in the To-Line of the 
email")
+            .description("The recipients to include in the To-Line of the 
email. "
+                    + "Comma separated sequence of addresses following RFC822 
syntax.")
             .required(false)
             
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
     public static final PropertyDescriptor CC = new 
PropertyDescriptor.Builder()
             .name("CC")
-            .description("The recipients to include in the CC-Line of the 
email")
+            .description("The recipients to include in the CC-Line of the 
email. "
+                    + "Comma separated sequence of addresses following RFC822 
syntax.")
             .required(false)
             
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             .build();
     public static final PropertyDescriptor BCC = new 
PropertyDescriptor.Builder()
             .name("BCC")
-            .description("The recipients to include in the BCC-Line of the 
email")
+            .description("The recipients to include in the BCC-Line of the 
email. "
+                    + "Comma separated sequence of addresses following RFC822 
syntax.")
             .required(false)
             
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)

http://git-wip-us.apache.org/repos/asf/nifi/blob/768bcfb5/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
index 7df04ba..97ff77e 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
@@ -264,9 +264,11 @@ public class TestPutEmail {
         // verifies that are set on the outgoing Message correctly
         runner.setProperty(PutEmail.SMTP_HOSTNAME, "smtp-host");
         runner.setProperty(PutEmail.HEADER_XMAILER, "TestingNiFi");
-        runner.setProperty(PutEmail.FROM, "[email protected]");
+        runner.setProperty(PutEmail.FROM, "[email protected],[email protected]");
         runner.setProperty(PutEmail.MESSAGE, "${body}");
-        runner.setProperty(PutEmail.TO, "[email protected]");
+        runner.setProperty(PutEmail.TO, 
"[email protected],[email protected]");
+        runner.setProperty(PutEmail.CC, 
"[email protected],[email protected]");
+        runner.setProperty(PutEmail.BCC, 
"[email protected],[email protected]");
         runner.setProperty(PutEmail.CONTENT_AS_MESSAGE, "${sendContent}");
 
         Map<String, String> attributes = new HashMap<String, String>();
@@ -283,11 +285,15 @@ public class TestPutEmail {
         assertEquals("Expected a single message to be sent", 1, 
processor.getMessages().size());
         Message message = processor.getMessages().get(0);
         assertEquals("[email protected]", message.getFrom()[0].toString());
+        assertEquals("[email protected]", message.getFrom()[1].toString());
         assertEquals("X-Mailer Header", "TestingNiFi", 
message.getHeader("X-Mailer")[0]);
         assertEquals("Some Text", message.getContent());
         assertEquals("[email protected]", 
message.getRecipients(RecipientType.TO)[0].toString());
-        assertNull(message.getRecipients(RecipientType.BCC));
-        assertNull(message.getRecipients(RecipientType.CC));
+        assertEquals("[email protected]", 
message.getRecipients(RecipientType.TO)[1].toString());
+        assertEquals("[email protected]", 
message.getRecipients(RecipientType.CC)[0].toString());
+        assertEquals("[email protected]", 
message.getRecipients(RecipientType.CC)[1].toString());
+        assertEquals("[email protected]", 
message.getRecipients(RecipientType.BCC)[0].toString());
+        assertEquals("[email protected]", 
message.getRecipients(RecipientType.BCC)[1].toString());
     }
 
 }

Reply via email to