[ 
https://issues.apache.org/jira/browse/NIFI-1449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15892348#comment-15892348
 ] 

ASF GitHub Bot commented on NIFI-1449:
--------------------------------------

Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1553#discussion_r103939988
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutEmail.java
 ---
    @@ -102,13 +91,16 @@ public void testExceptionWhenSending() {
     
             runner.assertQueueEmpty();
             runner.assertAllFlowFilesTransferred(PutEmail.REL_FAILURE);
    -        assertEquals("Expected an attempt to send a single message", 1, 
processor.getMessages().size());
    +        List<MockFlowFile> results = 
runner.getFlowFilesForRelationship(PutEmail.REL_FAILURE);
    +        assertEquals("Expected an attempt to send a single message", 1, 
results.size());
         }
     
         @Test
         public void testOutgoingMessage() throws Exception {
             // verifies that are set on the outgoing Message correctly
    -        runner.setProperty(PutEmail.SMTP_HOSTNAME, "smtp-host");
    +        runner.setProperty(PutEmail.SMTP_AUTH, "false");
    +        runner.setProperty(PutEmail.SMTP_HOSTNAME, "localhost");
    +        runner.setProperty(PutEmail.SMTP_PORT, String.valueOf(port));
             runner.setProperty(PutEmail.HEADER_XMAILER, "TestingNiFi");
             runner.setProperty(PutEmail.FROM, "[email protected]");
    --- End diff --
    
    Not sure if that's ok to use legitimate email address as test data 
especially as TO/FROM email address. NOt saying it's wrong, simply raising the 
question.


> PutEmail needs more unit tests
> ------------------------------
>
>                 Key: NIFI-1449
>                 URL: https://issues.apache.org/jira/browse/NIFI-1449
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Joseph Percivall
>            Assignee: Andre F de Miranda
>
> Currently the standard processor PutEmail only has two units. One verifies 
> "testHostNotFound" and the other "testEmailPropertyFormatters". Both route to 
> failure. There is no checking that the processor actually functions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to