diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-06-20 15:38:20 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-06-29 17:23:19 +0200 |
commit | e5eb765a319edacb43ab7cfa5714659deb1fcad0 (patch) | |
tree | 232fdc5a607ef292d5c3ac62c85b97b632232033 /tests | |
parent | 2f3ccdc9055cf911711bff699849c8f0002eb20f (diff) | |
download | sonarqube-e5eb765a319edacb43ab7cfa5714659deb1fcad0.tar.gz sonarqube-e5eb765a319edacb43ab7cfa5714659deb1fcad0.zip |
SONAR-9442 add names of changed quality profiles in mail notification
Diffstat (limited to 'tests')
3 files changed, 11 insertions, 8 deletions
diff --git a/tests/plugins/foo-plugin-v1/src/main/java/org/sonar/foo/Foo.java b/tests/plugins/foo-plugin-v1/src/main/java/org/sonar/foo/Foo.java index 522bc81483d..a2b2d237b01 100644 --- a/tests/plugins/foo-plugin-v1/src/main/java/org/sonar/foo/Foo.java +++ b/tests/plugins/foo-plugin-v1/src/main/java/org/sonar/foo/Foo.java @@ -24,7 +24,7 @@ import org.sonar.api.resources.Language; public class Foo implements Language { public static final String KEY = "foo"; - public static final String NAME = "foo"; + public static final String NAME = "Foo"; @Override public String getKey() { diff --git a/tests/plugins/foo-plugin-v2/src/main/java/org/sonar/foo/Foo.java b/tests/plugins/foo-plugin-v2/src/main/java/org/sonar/foo/Foo.java index 522bc81483d..a2b2d237b01 100644 --- a/tests/plugins/foo-plugin-v2/src/main/java/org/sonar/foo/Foo.java +++ b/tests/plugins/foo-plugin-v2/src/main/java/org/sonar/foo/Foo.java @@ -24,7 +24,7 @@ import org.sonar.api.resources.Language; public class Foo implements Language { public static final String KEY = "foo"; - public static final String NAME = "foo"; + public static final String NAME = "Foo"; @Override public String getKey() { diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java index 9960e8b7c42..4f287380171 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java @@ -22,6 +22,7 @@ package org.sonarqube.tests.qualityProfile; import com.sonar.orchestrator.Orchestrator; import java.io.File; +import java.util.List; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.junit.After; @@ -129,15 +130,17 @@ public class BuiltInQualityProfilesNotificationTest { orchestrator.restartServer(); waitUntilAllNotificationsAreDelivered(2, 10, 1_000); - assertThat(smtpServer.getMessages()) + List<WiserMessage> messages = smtpServer.getMessages(); + assertThat(messages) .extracting(this::getMimeMessage) .extracting(this::getAllRecipients) .containsOnly("<" + profileAdmin1.getEmail() + ">", "<" + profileAdmin2.getEmail() + ">"); - assertThat(smtpServer.getMessages()) - .extracting(this::getMimeMessage) - .extracting(this::getContent) - .extracting(m -> m.contains("This is a test message from SonarQube")) - .containsOnly(true); + assertThat(messages.get(0).getMimeMessage().getContent().toString()) + .containsSequence( + "Built-in quality profiles have been updated:", + "\"Basic\" - Foo", + "This is a good time to review your quality profiles and update them to benefit from the latest evolutions.") + .isEqualTo(messages.get(1).getMimeMessage().getContent().toString()); } private MimeMessage getMimeMessage(WiserMessage msg) { |