aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAnita Stanisz <106669481+anita-stanisz-sonarsource@users.noreply.github.com>2024-11-29 15:43:07 +0100
committersonartech <sonartech@sonarsource.com>2024-11-29 20:03:08 +0000
commit170f39121421b369abf7fda95fb1b47f57e1362a (patch)
tree7d67d30f9b920cd498048137799877db61ebf120 /server
parent4661c2a6d14d3b473ba4441b05f46b76e9cf18eb (diff)
downloadsonarqube-170f39121421b369abf7fda95fb1b47f57e1362a.tar.gz
sonarqube-170f39121421b369abf7fda95fb1b47f57e1362a.zip
SQRP-119 (#12446)
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSmtpConfiguration.java4
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java2
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java2
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java2
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java2
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java20
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/email-notification/EmailNotificationConfiguration.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/email-notification/__tests__/EmailNotification-it.tsx8
-rw-r--r--server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/resource/EmailConfigurationResource.java4
9 files changed, 24 insertions, 24 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSmtpConfiguration.java b/server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSmtpConfiguration.java
index d6acaead6e7..883b5ce0e49 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSmtpConfiguration.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSmtpConfiguration.java
@@ -38,9 +38,9 @@ public class EmailSmtpConfiguration {
public static final String EMAIL_CONFIG_FROM = "email.from";
public static final String EMAIL_CONFIG_FROM_DEFAULT = "noreply@nowhere";
public static final String EMAIL_CONFIG_FROM_NAME = "email.fromName";
- public static final String EMAIL_CONFIG_FROM_NAME_DEFAULT = "SonarQube Server";
+ public static final String EMAIL_CONFIG_FROM_NAME_DEFAULT = "SonarQube";
public static final String EMAIL_CONFIG_PREFIX = "email.prefix";
- public static final String EMAIL_CONFIG_PREFIX_DEFAULT = "[SONARQUBE SERVER]";
+ public static final String EMAIL_CONFIG_PREFIX_DEFAULT = "[SONARQUBE]";
// Auth selection
public static final String EMAIL_CONFIG_SMTP_AUTH_METHOD = "email.smtp.auth.method";
public static final String EMAIL_CONFIG_SMTP_AUTH_METHOD_DEFAULT = "BASIC";
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java
index f24ddfccca5..8debc1f4c1e 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java
@@ -244,7 +244,7 @@ public abstract class IssueChangesEmailTemplate implements EmailTemplate {
s.append("<small>");
s.append("You received this email because you are subscribed to ")
.append('"').append(i18n.message(Locale.ENGLISH, notificationI18nKey, notificationI18nKey)).append('"')
- .append(" notifications from SonarQube Server.");
+ .append(" notifications from SonarQube.");
s.append(" Click ");
link(s, s1 -> s1.append(settings.getServerBaseURL()).append("/account/notifications"), s1 -> s1.append("here"));
s.append(" to edit your email preferences.");
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java
index 37e837106b2..f4005480631 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java
@@ -287,7 +287,7 @@ public class EmailNotificationChannel extends NotificationChannel {
email.addHeader(REFERENCES_HEADER, messageId);
}
// Set headers for proper filtering
- email.addHeader(LIST_ID_HEADER, "SonarQube Server <sonar." + host + ">");
+ email.addHeader(LIST_ID_HEADER, "SonarQube <sonar." + host + ">");
email.addHeader(LIST_ARCHIVE_HEADER, server.getPublicRootUrl());
}
}
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java
index b2c18994f20..009ed3c2d2d 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java
@@ -329,7 +329,7 @@ public class ChangesOnMyIssuesEmailTemplateTest {
// skip content
HtmlListAssert htmlListAssert = skipContent.apply(htmlAssert);
- String footerText = "You received this email because you are subscribed to \"" + wordingNotification + "\" notifications from SonarQube Server."
+ String footerText = "You received this email because you are subscribed to \"" + wordingNotification + "\" notifications from SonarQube."
+ " Click here to edit your email preferences.";
htmlListAssert.hasEmptyParagraph()
.hasParagraph(footerText)
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java
index df3912a4e56..967e5955cd8 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java
@@ -148,7 +148,7 @@ public class FpPrAcceptedEmailTemplateTest {
EmailMessage emailMessage = underTest.format(new FPOrAcceptedNotification(change, Collections.emptySet(), fpPrAccepted));
- String footerText = "You received this email because you are subscribed to \"" + wordingNotification + "\" notifications from SonarQube Server."
+ String footerText = "You received this email because you are subscribed to \"" + wordingNotification + "\" notifications from SonarQube."
+ " Click here to edit your email preferences.";
HtmlFragmentAssert.assertThat(emailMessage.getMessage())
.hasParagraph("Hi,")
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java
index 26b7ad0f615..750fdff9f10 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java
@@ -64,7 +64,7 @@ import static org.mockito.Mockito.when;
@RunWith(DataProviderRunner.class)
public class EmailNotificationChannelTest {
- private static final String SUBJECT_PREFIX = "[SONARQUBE SERVER]";
+ private static final String SUBJECT_PREFIX = "[SONARQUBE]";
@Rule
public LogTester logTester = new LogTester();
@@ -122,9 +122,9 @@ public class EmailNotificationChannelTest {
MimeMessage email = messages.get(0).getMimeMessage();
assertThat(email.getHeader("Content-Type", null)).isEqualTo("text/plain; charset=UTF-8");
- assertThat(email.getHeader("From", ",")).isEqualTo("SonarQube Server from NoWhere <server@nowhere>");
+ assertThat(email.getHeader("From", ",")).isEqualTo("SonarQube from NoWhere <server@nowhere>");
assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
- assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE SERVER] Test Message from SonarQube");
+ assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Test Message from SonarQube");
assertThat((String) email.getContent()).startsWith("This is a test message from SonarQube.\r\n\r\nMail sent from: http://nemo.sonarsource.org");
}
@@ -184,12 +184,12 @@ public class EmailNotificationChannelTest {
assertThat(email.getHeader("In-Reply-To", null)).isEqualTo("<reviews/view/1@nemo.sonarsource.org>");
assertThat(email.getHeader("References", null)).isEqualTo("<reviews/view/1@nemo.sonarsource.org>");
- assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube Server <sonar.nemo.sonarsource.org>");
+ assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube <sonar.nemo.sonarsource.org>");
assertThat(email.getHeader("List-Archive", null)).isEqualTo("http://nemo.sonarsource.org");
- assertThat(email.getHeader("From", ",")).isEqualTo("\"Full Username (SonarQube Server from NoWhere)\" <server@nowhere>");
+ assertThat(email.getHeader("From", ",")).isEqualTo("\"Full Username (SonarQube from NoWhere)\" <server@nowhere>");
assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
- assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE SERVER] Review #3");
+ assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Review #3");
assertThat((String) email.getContent()).startsWith("I'll take care of this violation.");
assertThat(delivered).isTrue();
}
@@ -213,12 +213,12 @@ public class EmailNotificationChannelTest {
assertThat(email.getHeader("In-Reply-To", null)).isNull();
assertThat(email.getHeader("References", null)).isNull();
- assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube Server <sonar.nemo.sonarsource.org>");
+ assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube <sonar.nemo.sonarsource.org>");
assertThat(email.getHeader("List-Archive", null)).isEqualTo("http://nemo.sonarsource.org");
- assertThat(email.getHeader("From", null)).isEqualTo("SonarQube Server from NoWhere <server@nowhere>");
+ assertThat(email.getHeader("From", null)).isEqualTo("SonarQube from NoWhere <server@nowhere>");
assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
- assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE SERVER] Foo");
+ assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Foo");
assertThat((String) email.getContent()).startsWith("Bar");
assertThat(delivered).isTrue();
}
@@ -380,7 +380,7 @@ public class EmailNotificationChannelTest {
when(configuration.getSmtpPort()).thenReturn(smtpServer.getServer().getPort());
when(configuration.getSecureConnection()).thenReturn("NONE");
when(configuration.getFrom()).thenReturn("server@nowhere");
- when(configuration.getFromName()).thenReturn("SonarQube Server from NoWhere");
+ when(configuration.getFromName()).thenReturn("SonarQube from NoWhere");
when(configuration.getPrefix()).thenReturn(SUBJECT_PREFIX);
when(server.getPublicRootUrl()).thenReturn("http://nemo.sonarsource.org");
}
diff --git a/server/sonar-web/src/main/js/apps/settings/components/email-notification/EmailNotificationConfiguration.tsx b/server/sonar-web/src/main/js/apps/settings/components/email-notification/EmailNotificationConfiguration.tsx
index 2aee4a62b9b..4733f28e9e8 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/email-notification/EmailNotificationConfiguration.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/email-notification/EmailNotificationConfiguration.tsx
@@ -44,11 +44,11 @@ const EMAIL_CONFIGURATION_DEFAULT: EmailConfiguration = {
authMethod: AuthMethod.Basic,
basicPassword: '',
fromAddress: '',
- fromName: 'SonarQube Server',
+ fromName: 'SonarQube',
host: '',
port: '587',
securityProtocol: '',
- subjectPrefix: '[SonarQube Server]',
+ subjectPrefix: '[SonarQube]',
username: '',
};
diff --git a/server/sonar-web/src/main/js/apps/settings/components/email-notification/__tests__/EmailNotification-it.tsx b/server/sonar-web/src/main/js/apps/settings/components/email-notification/__tests__/EmailNotification-it.tsx
index 725ea7f591c..bd8e953b542 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/email-notification/__tests__/EmailNotification-it.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/email-notification/__tests__/EmailNotification-it.tsx
@@ -144,8 +144,8 @@ describe('Email Basic Configuration', () => {
expect(ui.port.get()).toHaveValue(587);
expect(ui.securityProtocol.get()).toHaveValue('');
expect(ui.fromAddress.get()).toHaveValue('');
- expect(ui.fromName.get()).toHaveValue('SonarQube Server');
- expect(ui.subjectPrefix.get()).toHaveValue('[SonarQube Server]');
+ expect(ui.fromName.get()).toHaveValue('SonarQube');
+ expect(ui.subjectPrefix.get()).toHaveValue('[SonarQube]');
await user.type(ui.basic_password.get(), 'password');
await user.type(ui.host.get(), 'host');
@@ -309,8 +309,8 @@ describe('Email Oauth Configuration', () => {
expect(ui.port.get()).toHaveValue(587);
expect(ui.securityProtocol.get()).toHaveValue('');
expect(ui.fromAddress.get()).toHaveValue('');
- expect(ui.fromName.get()).toHaveValue('SonarQube Server');
- expect(ui.subjectPrefix.get()).toHaveValue('[SonarQube Server]');
+ expect(ui.fromName.get()).toHaveValue('SonarQube');
+ expect(ui.subjectPrefix.get()).toHaveValue('[SonarQube]');
await user.type(ui.oauth_auth_host.get(), 'oauth_auth_host');
await user.type(ui.oauth_client_id.get(), 'oauth_client_id');
diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/resource/EmailConfigurationResource.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/resource/EmailConfigurationResource.java
index 47245b842ab..ca2a6db0638 100644
--- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/resource/EmailConfigurationResource.java
+++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/email/config/resource/EmailConfigurationResource.java
@@ -39,10 +39,10 @@ public record EmailConfigurationResource(
@Schema(description = "Address emails will come from")
String fromAddress,
- @Schema(description = "Name emails will come from (usually \"SonarQube Server\")")
+ @Schema(description = "Name emails will come from (usually \"SonarQube\")")
String fromName,
- @Schema(description = "Prefix added to email so they can be easily recognized (usually \"[SonarQube Server]\")")
+ @Schema(description = "Prefix added to email so they can be easily recognized (usually \"[SonarQube]\")")
String subjectPrefix,
@Schema(description = "Authentication method used to connect to the SMTP server. OAuth is only supported for Microsoft Exchange")