|
|
|
@ -77,60 +77,60 @@ public class EmailAlertChannelTest {
|
|
|
|
|
|
|
|
|
|
public String getEmailAlertParams() { |
|
|
|
|
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") |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).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()) |
|
|
|
|
.setValue("smtp.126.com") |
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
InputParam mailSmtpPort = InputParam.newBuilder("serverPort", "smtp.port") |
|
|
|
|
InputParam mailSmtpPort = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_PORT, "smtp.port") |
|
|
|
|
.addValidate(Validate.newBuilder() |
|
|
|
|
.setRequired(true) |
|
|
|
|
.build()) |
|
|
|
|
.setValue("25") |
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
InputParam mailSender = InputParam.newBuilder("sender", "sender") |
|
|
|
|
InputParam mailSender = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SENDER, "sender") |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
|
.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("NO", "false", false)) |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
|
.setValue("false") |
|
|
|
|
.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") |
|
|
|
|
.setValue("dolphinscheduler@126.com") |
|
|
|
|
.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") |
|
|
|
|
.setValue("escheduler123") |
|
|
|
|
.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("NO", "false", false)) |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
|
.setValue("true") |
|
|
|
|
.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("NO", "false", false)) |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
|
.setValue("true") |
|
|
|
|
.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()) |
|
|
|
|
.setValue("smtp.126.com") |
|
|
|
|
.build(); |
|
|
|
@ -140,7 +140,7 @@ public class EmailAlertChannelTest {
|
|
|
|
|
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.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) |
|
|
|
|
.setValue(ShowType.TABLE.getDescp()) |
|
|
|
|
.addValidate(Validate.newBuilder().setRequired(true).build()) |
|
|
|
|