diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPlugin.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPlugin.java index 3ec6da348c..d06e12d941 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPlugin.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPlugin.java @@ -56,7 +56,7 @@ public class EmailAlertPlugin implements AlertPlugin { @Override public String getId() { - return Constants.PLUGIN_DEFAULT_EMAIL; + return Constants.PLUGIN_DEFAULT_EMAIL_ID; } @Override diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java index d3ac852b0f..122f1bf02d 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java @@ -80,7 +80,7 @@ public class AlertSender { alertInfo.addProp("receivers", receviersList); - AlertPlugin emailPlugin = pluginManager.findOne(Constants.PLUGIN_DEFAULT_EMAIL); + AlertPlugin emailPlugin = pluginManager.findOne(Constants.PLUGIN_DEFAULT_EMAIL_ID); retMaps = emailPlugin.process(alertInfo); if (retMaps == null) { diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/Constants.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/Constants.java index e1b127b423..ec47a1e153 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/Constants.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/Constants.java @@ -179,7 +179,7 @@ public class Constants { */ public static final String PLUGIN_DIR = "plugin.dir"; - public static final String PLUGIN_DEFAULT_EMAIL = "email"; + public static final String PLUGIN_DEFAULT_EMAIL_ID = "email"; public static final String PLUGIN_DEFAULT_EMAIL_CH = "邮件"; diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java index 52c2fc050e..c2f4006752 100644 --- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java +++ b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java @@ -47,7 +47,7 @@ public class EmailAlertPluginTest { @Test public void getId() { String id = plugin.getId(); - assertEquals(Constants.PLUGIN_DEFAULT_EMAIL, id); + assertEquals(Constants.PLUGIN_DEFAULT_EMAIL_ID, id); } @Test diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/plugin/FilePluginManager.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/plugin/FilePluginManager.java index d4dd4bf283..cde299f9dd 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/plugin/FilePluginManager.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/plugin/FilePluginManager.java @@ -90,8 +90,8 @@ public class FilePluginManager implements PluginManager { } @Override - public AlertPlugin findOne(String name) { - return pluginMap.get(name); + public AlertPlugin findOne(String pluginId) { + return pluginMap.get(pluginId); } @Override