import java.net.URLEncoder;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.notifications.Notification;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
+import org.sonar.server.issue.notification.EmailMessage;
+import org.sonar.server.issue.notification.EmailTemplate;
import static org.sonar.api.utils.DateUtils.formatDateTime;
import org.sonar.api.notifications.Notification;
import org.sonar.api.rules.RuleType;
import org.sonar.api.utils.DateUtils;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
import org.sonar.server.issue.notification.NewIssuesStatistics.Metric;
import static com.google.common.base.Preconditions.checkNotNull;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.server.issue.notification;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class EmailMessage {
+
+ private String from;
+ private String to;
+ private String subject;
+ private String message;
+ private String messageId;
+
+ /**
+ * @param from full name of user, who initiated this message or null, if message was initiated by Sonar
+ */
+ public EmailMessage setFrom(String from) {
+ this.from = from;
+ return this;
+ }
+
+ /**
+ * @see #setFrom(String)
+ */
+ public String getFrom() {
+ return from;
+ }
+
+ /**
+ * @param to email address where to send this message
+ */
+ public EmailMessage setTo(String to) {
+ this.to = to;
+ return this;
+ }
+
+ /**
+ * @see #setTo(String)
+ */
+ public String getTo() {
+ return to;
+ }
+
+ /**
+ * @param subject message subject
+ */
+ public EmailMessage setSubject(String subject) {
+ this.subject = subject;
+ return this;
+ }
+
+ /**
+ * @see #setSubject(String)
+ */
+ public String getSubject() {
+ return subject;
+ }
+
+ /**
+ * @param message message body
+ */
+ public EmailMessage setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * @see #setMessage(String)
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * @param messageId id of message for threading
+ */
+ public EmailMessage setMessageId(String messageId) {
+ this.messageId = messageId;
+ return this;
+ }
+
+ /**
+ * @see #setMessageId(String)
+ */
+ public String getMessageId() {
+ return messageId;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.server.issue.notification;
+
+import org.sonar.api.ExtensionPoint;
+import org.sonar.api.server.ServerSide;
+import org.sonar.api.notifications.Notification;
+
+@ServerSide
+@ExtensionPoint
+public abstract class EmailTemplate {
+
+ public abstract EmailMessage format(Notification notification);
+
+}
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.user.UserDto;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
import static java.net.URLEncoder.encode;
import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate.FIELD_BRANCH;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.user.UserDto;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
+import org.sonar.server.issue.notification.EmailMessage;
+import org.sonar.server.issue.notification.EmailTemplate;
import static java.util.Objects.requireNonNull;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.measures.Metric;
import org.sonar.api.notifications.Notification;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
+import org.sonar.server.issue.notification.EmailMessage;
+import org.sonar.server.issue.notification.EmailTemplate;
/**
* Creates email message for notification "alerts".
import org.sonar.api.notifications.Notification;
import org.sonar.db.DbTester;
import org.sonar.db.user.UserDto;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.CoreProperties.SERVER_BASE_URL;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.notifications.Notification;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.sonar.server.l18n.I18nRule;
import static org.assertj.core.api.Assertions.assertThat;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.notifications.Notification;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.sonar.server.l18n.I18nRule;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.notifications.Notification;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
+import org.sonar.server.issue.notification.EmailMessage;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.Date;
import org.sonar.api.notifications.Notification;
import org.sonar.api.platform.Server;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
-import org.sonar.plugins.emailnotifications.api.EmailTemplate;
+import org.sonar.server.issue.notification.EmailMessage;
+import org.sonar.server.issue.notification.EmailTemplate;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.sonar.api.utils.DateUtils.formatDate;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.EmailSettings;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
+import org.sonar.server.issue.notification.EmailMessage;
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.platform.Server;
-import org.sonar.plugins.emailnotifications.api.EmailMessage;
+import org.sonar.server.issue.notification.EmailMessage;
import org.sonar.server.qualityprofile.BuiltInQPChangeNotificationBuilder.Profile;
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.plugins.emailnotifications.api;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * @since 2.10
- */
-public class EmailMessage {
-
- private String from;
- private String to;
- private String subject;
- private String message;
- private String messageId;
-
- /**
- * @param from full name of user, who initiated this message or null, if message was initiated by Sonar
- */
- public EmailMessage setFrom(String from) {
- this.from = from;
- return this;
- }
-
- /**
- * @see #setFrom(String)
- */
- public String getFrom() {
- return from;
- }
-
- /**
- * @param to email address where to send this message
- */
- public EmailMessage setTo(String to) {
- this.to = to;
- return this;
- }
-
- /**
- * @see #setTo(String)
- */
- public String getTo() {
- return to;
- }
-
- /**
- * @param subject message subject
- */
- public EmailMessage setSubject(String subject) {
- this.subject = subject;
- return this;
- }
-
- /**
- * @see #setSubject(String)
- */
- public String getSubject() {
- return subject;
- }
-
- /**
- * @param message message body
- */
- public EmailMessage setMessage(String message) {
- this.message = message;
- return this;
- }
-
- /**
- * @see #setMessage(String)
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * @param messageId id of message for threading
- */
- public EmailMessage setMessageId(String messageId) {
- this.messageId = messageId;
- return this;
- }
-
- /**
- * @see #setMessageId(String)
- */
- public String getMessageId() {
- return messageId;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.plugins.emailnotifications.api;
-
-import org.sonar.api.ExtensionPoint;
-import org.sonar.api.server.ServerSide;
-import org.sonar.api.notifications.Notification;
-
-/**
- * @since 2.10
- */
-@ServerSide
-@ExtensionPoint
-public abstract class EmailTemplate {
-
- public abstract EmailMessage format(Notification notification);
-
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2019 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.plugins.emailnotifications.api;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-