diff options
author | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2013-01-30 15:08:34 +0100 |
---|---|---|
committer | Fabrice Bellingard <fabrice.bellingard@sonarsource.com> | 2013-01-30 15:23:22 +0100 |
commit | c91f6e066a0d4917b2cbace325db9ac6a12c2913 (patch) | |
tree | ca2fc6dc23954c5a561ddbe9115dc75aec10a7bf /plugins/sonar-email-notifications-plugin/src | |
parent | 8f9dacd45c67012dae0dc06df4f2baa483164bc6 (diff) | |
download | sonarqube-c91f6e066a0d4917b2cbace325db9ac6a12c2913.tar.gz sonarqube-c91f6e066a0d4917b2cbace325db9ac6a12c2913.zip |
SONAR-3959 Add NotificationDispatcherMetadata class
Diffstat (limited to 'plugins/sonar-email-notifications-plugin/src')
2 files changed, 14 insertions, 4 deletions
diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationsPlugin.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationsPlugin.java index 16c3d9bf00a..d62857fbca8 100644 --- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationsPlugin.java +++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationsPlugin.java @@ -20,8 +20,8 @@ package org.sonar.plugins.emailnotifications; import com.google.common.collect.ImmutableList; -import org.sonar.api.ServerExtension; import org.sonar.api.SonarPlugin; +import org.sonar.api.notifications.NotificationDispatcherMetadata; import org.sonar.plugins.emailnotifications.alerts.AlertsEmailTemplate; import org.sonar.plugins.emailnotifications.alerts.AlertsOnMyFavouriteProject; import org.sonar.plugins.emailnotifications.newviolations.NewViolationsEmailTemplate; @@ -32,18 +32,28 @@ import org.sonar.plugins.emailnotifications.reviews.ReviewEmailTemplate; import java.util.List; public class EmailNotificationsPlugin extends SonarPlugin { - public List<Class<? extends ServerExtension>> getExtensions() { + public List<?> getExtensions() { return ImmutableList.of( EmailNotificationChannel.class, + // Notify incoming violations on my favourite projects NewViolationsOnMyFavouriteProject.class, + NotificationDispatcherMetadata.create("NewViolationsOnMyFavouriteProject") + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true"), NewViolationsEmailTemplate.class, + // Notify reviews changes ChangesInReviewAssignedToMeOrCreatedByMe.class, + NotificationDispatcherMetadata.create("ChangesInReviewAssignedToMeOrCreatedByMe") + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true"), ReviewEmailTemplate.class, + // Notify alerts on my favourite projects AlertsOnMyFavouriteProject.class, + NotificationDispatcherMetadata.create("AlertsOnMyFavouriteProject") + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true"), AlertsEmailTemplate.class - ); + + ); } } diff --git a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationsPluginTest.java b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationsPluginTest.java index aeb4755d940..55096f5565b 100644 --- a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationsPluginTest.java +++ b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationsPluginTest.java @@ -26,6 +26,6 @@ import static org.fest.assertions.Assertions.assertThat; public class EmailNotificationsPluginTest { @Test public void should_get_extensions() { - assertThat(new EmailNotificationsPlugin().getExtensions()).hasSize(7); + assertThat(new EmailNotificationsPlugin().getExtensions()).hasSize(10); } } |