You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mo...@apache.org on 2018/10/07 21:36:13 UTC

nifi git commit: NIFI-5635 - Description PutEmail properties with multiple senders/recipients

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 <mo...@apache.org>


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 <pi...@gmail.com>
Authored: Tue Sep 25 22:53:28 2018 +0200
Committer: Mike Moser <mo...@apache.org>
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, "test@apache.org");
+        runner.setProperty(PutEmail.FROM, "test@apache.org,from@apache.org");
         runner.setProperty(PutEmail.MESSAGE, "${body}");
-        runner.setProperty(PutEmail.TO, "recipient@apache.org");
+        runner.setProperty(PutEmail.TO, "recipient@apache.org,another@apache.org");
+        runner.setProperty(PutEmail.CC, "recipientcc@apache.org,anothercc@apache.org");
+        runner.setProperty(PutEmail.BCC, "recipientbcc@apache.org,anotherbcc@apache.org");
         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("test@apache.org", message.getFrom()[0].toString());
+        assertEquals("from@apache.org", message.getFrom()[1].toString());
         assertEquals("X-Mailer Header", "TestingNiFi", message.getHeader("X-Mailer")[0]);
         assertEquals("Some Text", message.getContent());
         assertEquals("recipient@apache.org", message.getRecipients(RecipientType.TO)[0].toString());
-        assertNull(message.getRecipients(RecipientType.BCC));
-        assertNull(message.getRecipients(RecipientType.CC));
+        assertEquals("another@apache.org", message.getRecipients(RecipientType.TO)[1].toString());
+        assertEquals("recipientcc@apache.org", message.getRecipients(RecipientType.CC)[0].toString());
+        assertEquals("anothercc@apache.org", message.getRecipients(RecipientType.CC)[1].toString());
+        assertEquals("recipientbcc@apache.org", message.getRecipients(RecipientType.BCC)[0].toString());
+        assertEquals("anotherbcc@apache.org", message.getRecipients(RecipientType.BCC)[1].toString());
     }
 
 }