aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-06-23 15:12:35 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-06-29 17:23:19 +0200
commitfdc0cf83bbe58b24504bbafa52dfa135cbbb17c6 (patch)
tree6ffae69b6ef4817a9fde46a1832a3cf5a752318f /server
parent40977f259975faee0c9e5f59ae1228ed89138bb9 (diff)
downloadsonarqube-fdc0cf83bbe58b24504bbafa52dfa135cbbb17c6.tar.gz
sonarqube-fdc0cf83bbe58b24504bbafa52dfa135cbbb17c6.zip
SONAR-9442 Update notification first sentence and add line breaks
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplate.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplateTest.java6
2 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplate.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplate.java
index e30294c2ada..8572d30e8a1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplate.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplate.java
@@ -49,8 +49,7 @@ public class BuiltInQualityProfilesNotificationTemplate extends EmailTemplate {
}
BuiltInQualityProfilesNotification profilesNotification = parse(notification);
-
- StringBuilder message = new StringBuilder("Built-in quality profiles have been updated:\n");
+ StringBuilder message = new StringBuilder("The following built-in profiles have been updated:\n\n");
profilesNotification.getProfiles().stream()
.sorted(Comparator.comparing(Profile::getLanguageName).thenComparing(Profile::getProfileName))
.forEach(profile -> {
@@ -80,6 +79,7 @@ public class BuiltInQualityProfilesNotificationTemplate extends EmailTemplate {
if (removedRules > 0) {
message.append(" ").append(removedRules).append(" rules removed\n");
}
+ message.append("\n");
});
message.append("This is a good time to review your quality profiles and update them to benefit from the latest evolutions: ");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplateTest.java
index 176a22aa7e7..c3514e636a2 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplateTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInQualityProfilesNotificationTemplateTest.java
@@ -169,7 +169,7 @@ public class BuiltInQualityProfilesNotificationTemplateTest {
EmailMessage emailMessage = underTest.format(notification.serialize());
- assertThat(emailMessage.getMessage()).containsSequence("Built-in quality profiles have been updated:\n",
+ assertThat(emailMessage.getMessage()).containsSequence("The following built-in profiles have been updated:\n",
profileTitleText(profileName1, languageKey1, languageName1),
" 2 new rules\n",
profileTitleText(profileName2, languageKey2, languageName2),
@@ -236,9 +236,9 @@ public class BuiltInQualityProfilesNotificationTemplateTest {
}
private void assertMessage(EmailMessage emailMessage, String expectedProfileDetails) {
- assertThat(emailMessage.getMessage()).containsSequence("Built-in quality profiles have been updated:\n",
+ assertThat(emailMessage.getMessage()).containsSequence("The following built-in profiles have been updated:\n\n",
expectedProfileDetails,
- "This is a good time to review your quality profiles and update them to benefit from the latest evolutions: " + server.getPublicRootUrl() + "/profiles");
+ "\nThis is a good time to review your quality profiles and update them to benefit from the latest evolutions: " + server.getPublicRootUrl() + "/profiles");
}
private String profileTitleText(String profileName, String languageKey, String languageName) {