import org.sonar.server.qualitygate.QualityGateModule;
import org.sonar.server.qualityprofile.BuiltInQProfileDefinitionsBridge;
import org.sonar.server.qualityprofile.BuiltInQProfileRepositoryImpl;
+import org.sonar.server.qualityprofile.BuiltInQualityProfilesNotificationDispatcher;
+import org.sonar.server.qualityprofile.BuiltInQualityProfilesNotificationTemplate;
import org.sonar.server.qualityprofile.QProfileBackuperImpl;
import org.sonar.server.qualityprofile.QProfileComparison;
import org.sonar.server.qualityprofile.QProfileCopier;
MacroInterpreter.class,
// Notifications
+ // Those class are required in order to be able to send emails during startup
+ // Without having two NotificationModule (one in StartupLevel and one in Level4)
+ BuiltInQualityProfilesNotificationTemplate.class,
+ BuiltInQualityProfilesNotificationDispatcher.class,
+
NotificationModule.class,
NotificationWsModule.class,
EmailsWsModule.class,
import org.sonar.server.app.ProcessCommandWrapper;
import org.sonar.server.es.IndexerStartupTask;
-import org.sonar.server.notification.NotificationModule;
import org.sonar.server.organization.DefaultOrganizationEnforcer;
import org.sonar.server.platform.ServerLifecycleNotifier;
import org.sonar.server.platform.web.RegisterServletFilters;
import org.sonar.server.qualityprofile.BuiltInQProfileInsertImpl;
import org.sonar.server.qualityprofile.BuiltInQProfileLoader;
import org.sonar.server.qualityprofile.BuiltInQProfileUpdateImpl;
-import org.sonar.server.qualityprofile.BuiltInQualityProfilesNotificationDispatcher;
-import org.sonar.server.qualityprofile.BuiltInQualityProfilesNotificationTemplate;
import org.sonar.server.qualityprofile.BuiltInQualityProfilesUpdateListener;
import org.sonar.server.qualityprofile.RegisterQualityProfiles;
import org.sonar.server.rule.RegisterRules;
import org.sonar.server.startup.GeneratePluginIndex;
import org.sonar.server.startup.RegisterMetrics;
import org.sonar.server.startup.RegisterPermissionTemplates;
-import org.sonar.server.startup.RenameDeprecatedPropertyKeys;
import org.sonar.server.startup.RegisterPlugins;
+import org.sonar.server.startup.RenameDeprecatedPropertyKeys;
import org.sonar.server.user.DoPrivileged;
import org.sonar.server.user.ThreadLocalUserSession;
RegisterRules.class);
add(BuiltInQProfileLoader.class);
addIfStartupLeader(
- // TODO Should we put it in level 2 ?
- NotificationModule.class,
- BuiltInQualityProfilesNotificationDispatcher.class,
- BuiltInQualityProfilesNotificationTemplate.class,
BuiltInQualityProfilesUpdateListener.class,
BuiltInQProfileInsertImpl.class,
BuiltInQProfileUpdateImpl.class,
public void send_mail_if_quality_profile_is_updated() throws Exception {
orchestrator = Orchestrator.builderEnv()
.addPlugin(pluginArtifact("foo-plugin-v1"))
+ .setServerProperty("sonar.notifications.delay", "1")
.setServerProperty("email.smtp_host.secured", "localhost")
.setServerProperty("email.smtp_port.secured", Integer.toString(smtpServer.getServer().getPort()))
.build();