}
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 -> {
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: ");
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),
}
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) {
String url = orchestrator.getServer().getUrl();
assertThat(messages.get(0).getMimeMessage().getContent().toString())
.containsSequence(
- "Built-in quality profiles have been updated:",
+ "The following built-in profiles have been updated:",
"\"Basic\" - Foo: " + url + "/profiles/changelog?language=foo&name=Basic&since=", "&to=",
" 1 new rules",
" 3 rules have been updated",