aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-06-23 09:06:41 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-06-29 17:23:19 +0200
commite58f19cefe30d06275e45ab44e6d01a69a794676 (patch)
treef3957e7e0b6a82fa1f93dfcb821902b16262c9c1 /tests/src
parent4546ffeb44cb56bcf909e4506f255c354eba3e86 (diff)
downloadsonarqube-e58f19cefe30d06275e45ab44e6d01a69a794676.tar.gz
sonarqube-e58f19cefe30d06275e45ab44e6d01a69a794676.zip
SONAR-9442 Add a suject in email sent to quality profiles admin
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java12
1 files changed, 12 insertions, 0 deletions
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 a0d8d90d368..d11f252ddad 100644
--- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java
@@ -131,6 +131,10 @@ public class BuiltInQualityProfilesNotificationTest {
.extracting(this::getMimeMessage)
.extracting(this::getAllRecipients)
.containsOnly("<" + profileAdmin1.getEmail() + ">", "<" + profileAdmin2.getEmail() + ">");
+ assertThat(messages)
+ .extracting(this::getMimeMessage)
+ .extracting(this::getSubject)
+ .containsOnly("[SONARQUBE] Built-in quality profiles have been updated");
String url = orchestrator.getServer().getUrl();
assertThat(messages.get(0).getMimeMessage().getContent().toString())
.containsSequence(
@@ -196,6 +200,14 @@ public class BuiltInQualityProfilesNotificationTest {
}
}
+ private String getSubject(MimeMessage mimeMessage) {
+ try {
+ return mimeMessage.getSubject();
+ } catch (MessagingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
private static void waitUntilAllNotificationsAreDelivered(int expectedNumberOfEmails, int pollNumber, int pollMillis) throws InterruptedException {
for (int i = 0; i < pollNumber; i++) {
if (smtpServer.getMessages().size() == expectedNumberOfEmails) {