SbloodyS commented on code in PR #16529:
URL: 
https://github.com/apache/dolphinscheduler/pull/16529#discussion_r1738082150


##########
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java:
##########
@@ -162,4 +162,14 @@ public void testTableAttachmentFile() {
         AlertResult alertResult = mailSender.sendMails("gaojing", content);
         Assertions.assertFalse(alertResult.isSuccess());
     }
+
+    @Test
+    public void testReceiversWithInvalidAddress() {
+        String content = list2String();
+        emailConfig.put(AlertConstants.NAME_SHOW_TYPE, 
ShowType.TABLE_ATTACHMENT.getDescp());
+        
emailConfig.put(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS, 
"[email protected],[email protected]");
+        mailSender = new MailSender(emailConfig);
+        AlertResult alertResult = mailSender.sendMails("gaojing", content);
+        Assertions.assertFalse(alertResult.isSuccess());
+    }

Review Comment:
   For the bug you fix, you should test the input of, say, 3 email addresses, 2 
of which are valid and 1 of which is invalid.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to