diff options
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) { |