|
|
@ -77,60 +77,60 @@ public class EmailAlertChannelTest { |
|
|
|
|
|
|
|
|
|
|
|
public String getEmailAlertParams() { |
|
|
|
public String getEmailAlertParams() { |
|
|
|
List<PluginParams> paramsList = new ArrayList<>(); |
|
|
|
List<PluginParams> paramsList = new ArrayList<>(); |
|
|
|
InputParam receivesParam = InputParam.newBuilder("receivers", "receivers") |
|
|
|
InputParam receivesParam = InputParam.newBuilder(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS, "receivers") |
|
|
|
.setValue("540957506@qq.com") |
|
|
|
.setValue("540957506@qq.com") |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
InputParam mailSmtpHost = InputParam.newBuilder("serverHost", "smtp.host") |
|
|
|
InputParam mailSmtpHost = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_HOST, "smtp.host") |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("smtp.126.com") |
|
|
|
.setValue("smtp.126.com") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
InputParam mailSmtpPort = InputParam.newBuilder("serverPort", "smtp.port") |
|
|
|
InputParam mailSmtpPort = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_PORT, "smtp.port") |
|
|
|
.addValidate(Validate.newBuilder() |
|
|
|
.addValidate(Validate.newBuilder() |
|
|
|
.setRequired(true) |
|
|
|
.setRequired(true) |
|
|
|
.build()) |
|
|
|
.build()) |
|
|
|
.setValue("25") |
|
|
|
.setValue("25") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
InputParam mailSender = InputParam.newBuilder("sender", "sender") |
|
|
|
InputParam mailSender = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SENDER, "sender") |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
RadioParam enableSmtpAuth = RadioParam.newBuilder("enableSmtpAuth", "smtp.auth") |
|
|
|
RadioParam enableSmtpAuth = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_AUTH, "smtp.auth") |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("false") |
|
|
|
.setValue("false") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
InputParam mailUser = InputParam.newBuilder("user", "user") |
|
|
|
InputParam mailUser = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_USER, "user") |
|
|
|
.setPlaceholder("if enable use authentication, you need input user") |
|
|
|
.setPlaceholder("if enable use authentication, you need input user") |
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
PasswordParam mailPassword = PasswordParam.newBuilder("passwd", "passwd") |
|
|
|
PasswordParam mailPassword = PasswordParam.newBuilder(MailParamsConstants.NAME_MAIL_PASSWD, "passwd") |
|
|
|
.setPlaceholder("if enable use authentication, you need input password") |
|
|
|
.setPlaceholder("if enable use authentication, you need input password") |
|
|
|
.setValue("escheduler123") |
|
|
|
.setValue("escheduler123") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
RadioParam enableTls = RadioParam.newBuilder("starttlsEnable", "starttls.enable") |
|
|
|
RadioParam enableTls = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE, "starttls.enable") |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("true") |
|
|
|
.setValue("true") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
RadioParam enableSsl = RadioParam.newBuilder("sslEnable", "smtp.ssl.enable") |
|
|
|
RadioParam enableSsl = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE, "smtp.ssl.enable") |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("YES", "true", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addParamsOptions(new ParamsOptions("NO", "false", false)) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("true") |
|
|
|
.setValue("true") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
InputParam sslTrust = InputParam.newBuilder("smtpSslTrust", "smtp.ssl.trust") |
|
|
|
InputParam sslTrust = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST, "smtp.ssl.trust") |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.setValue("smtp.126.com") |
|
|
|
.setValue("smtp.126.com") |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
@ -140,7 +140,7 @@ public class EmailAlertChannelTest { |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)); |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)); |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false)); |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false)); |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false)); |
|
|
|
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false)); |
|
|
|
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, "showType") |
|
|
|
RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, "showType") |
|
|
|
.setOptions(emailShowTypeList) |
|
|
|
.setOptions(emailShowTypeList) |
|
|
|
.setValue(ShowType.TABLE.getDescp()) |
|
|
|
.setValue(ShowType.TABLE.getDescp()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|