From f410dd2ba64a1b4047bb0d62a71520bfe4c8f1eb Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 14 Jun 2017 08:29:58 +0200 Subject: [PATCH] SONAR-9387 Fix usage of /dashboard/index/ in notification Replace usage of /dashboard/index/ by /dashboard?id= --- .../java/it/qualityGate/QualityGateNotificationTest.java | 2 +- .../server/notification/email/AlertsEmailTemplate.java | 2 +- .../notification/email/AlertsEmailTemplateTest.java | 8 ++++---- .../org/sonarsource/sonarqube/perf/server/WebTest.java | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java b/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java index b78a75afcc1..64f8dffa974 100644 --- a/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java +++ b/it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java @@ -137,7 +137,7 @@ public class QualityGateNotificationTest { assertThat(message.getHeader("To", null)).isEqualTo(""); assertThat((String) message.getContent()).contains("Quality gate status: Orange (was Green)"); assertThat((String) message.getContent()).contains("Quality gate threshold: Lines of Code variation = 0 since previous analysis"); - assertThat((String) message.getContent()).contains("/dashboard/index/sample"); + assertThat((String) message.getContent()).contains("/dashboard?id=sample"); assertThat(emails.hasNext()).isFalse(); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java b/server/sonar-server/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java index 4b2a342076d..4eb547b3821 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java +++ b/server/sonar-server/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java @@ -99,7 +99,7 @@ public class AlertsEmailTemplate extends EmailTemplate { } } - messageBody.append("\n").append("See it in SonarQube: ").append(configuration.getServerBaseURL()).append("/dashboard/index/").append(projectKey); + messageBody.append("\n").append("See it in SonarQube: ").append(configuration.getServerBaseURL()).append("/dashboard?id=").append(projectKey); return messageBody.toString(); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/notification/email/AlertsEmailTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/server/notification/email/AlertsEmailTemplateTest.java index f8888ef2035..01fc4bc81cd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notification/email/AlertsEmailTemplateTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/notification/email/AlertsEmailTemplateTest.java @@ -64,7 +64,7 @@ public class AlertsEmailTemplateTest { " - violations > 4\n" + " - coverage < 75%\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/dashboard/index/org.sonar.foo:foo")); + "See it in SonarQube: http://nemo.sonarsource.org/dashboard?id=org.sonar.foo:foo")); } @Test @@ -82,7 +82,7 @@ public class AlertsEmailTemplateTest { " - violations > 4\n" + " - coverage < 75%\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/dashboard/index/org.sonar.foo:foo")); + "See it in SonarQube: http://nemo.sonarsource.org/dashboard?id=org.sonar.foo:foo")); } @Test @@ -98,7 +98,7 @@ public class AlertsEmailTemplateTest { "\n" + "New quality gate threshold: violations > 4\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/dashboard/index/org.sonar.foo:foo")); + "See it in SonarQube: http://nemo.sonarsource.org/dashboard?id=org.sonar.foo:foo")); } @Test @@ -113,7 +113,7 @@ public class AlertsEmailTemplateTest { "Quality gate status: Green (was Red)\n" + "\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/dashboard/index/org.sonar.foo:foo")); + "See it in SonarQube: http://nemo.sonarsource.org/dashboard?id=org.sonar.foo:foo")); } private Notification createNotification(String alertName, String alertText, String alertLevel, String isNewAlert) { diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/WebTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/WebTest.java index 658e2c57ab7..3545682b2fc 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/WebTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/WebTest.java @@ -23,11 +23,11 @@ import com.github.kevinsawicki.http.HttpRequest; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.MavenBuild; import com.sonar.orchestrator.locator.FileLocation; -import org.junit.Ignore; -import org.sonarsource.sonarqube.perf.PerfTestCase; import org.junit.BeforeClass; import org.junit.ClassRule; +import org.junit.Ignore; import org.junit.Test; +import org.sonarsource.sonarqube.perf.PerfTestCase; import static org.junit.Assert.fail; @@ -98,7 +98,7 @@ public class WebTest extends PerfTestCase { @Test public void struts_dashboard() throws Exception { - PageStats counters = request("/dashboard/index/org.apache.struts:struts-parent?name=Custom"); + PageStats counters = request("/dashboard?id=org.apache.struts:struts-parent?name=Custom"); assertDurationLessThan(counters.durationMs, 400); } -- 2.39.5