From: Simon Brandhof Date: Fri, 20 Jun 2014 13:22:30 +0000 (+0200) Subject: SONAR-5007 improve logging of profile name X-Git-Tag: 4.4-RC1~238 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cbec70bdb42ff12d9235e91599fa59e07288b3b;p=sonarqube.git SONAR-5007 improve logging of profile name --- diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java index 783da3ec7bf..ec97754abef 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java @@ -62,6 +62,6 @@ public class QProfileName { @Override public String toString() { - return String.format("[%s, %s]", lang, name); + return String.format("{lang=%s, name=%s}", lang, name); } } diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java index 6a82bb51654..caaab96473b 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java @@ -96,7 +96,7 @@ public class QProfileFactoryMediumTest { factory.create(dbSession, name); fail(); } catch (BadRequestException e) { - assertThat(e).hasMessage("Quality profile already exists: QProfile{lang=xoo, name=P1}"); + assertThat(e).hasMessage("Quality profile already exists: {lang=xoo, name=P1}"); } } diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java index 00062ff8de9..ad57cc44ad4 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java @@ -41,6 +41,6 @@ public class QProfileNameTest { @Test public void to_string() throws Exception { - assertThat(new QProfileName("xoo", "p1").toString()).isEqualTo("[xoo, p1]"); + assertThat(new QProfileName("xoo", "p1").toString()).isEqualTo("{lang=xoo, name=p1}"); } }