From db57555d0d0ba1a58e4c9d9dc66632242166cde5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Mon, 17 Feb 2014 14:36:29 +0100 Subject: [PATCH] Remove repository key from rendering of rule macro --- .../src/main/java/org/sonar/server/text/RuleMacro.java | 2 +- .../test/java/org/sonar/server/text/MacroInterpreterTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java b/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java index e0209ef5699..795a305defa 100644 --- a/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java +++ b/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java @@ -36,6 +36,6 @@ class RuleMacro implements Macro { } public String getReplacement() { - return "$1:$2"; + return "$2"; } } diff --git a/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java b/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java index b23f84c0741..86c82fb0b43 100644 --- a/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java +++ b/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java @@ -53,7 +53,7 @@ public class MacroInterpreterTest { String ruleKey = "repo:key"; String origin = "See {rule:" + ruleKey + "} for detail."; String result = interpreter.interpret(origin); - assertThat(result).isEqualTo("See " + ruleKey + " for detail."); + assertThat(result).isEqualTo("See key for detail."); } @Test @@ -61,6 +61,6 @@ public class MacroInterpreterTest { String ruleKey = "my-repo1:my-key1"; String origin = "See {rule:" + ruleKey + "} for detail."; String result = interpreter.interpret(origin); - assertThat(result).isEqualTo("See " + ruleKey + " for detail."); + assertThat(result).isEqualTo("See my-key1 for detail."); } } -- 2.39.5