From cfe3de7f2d3acc59a4f5cea616cab0d5a9d9deee Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Fri, 14 Apr 2017 14:43:47 +0200 Subject: [PATCH] SONAR-8950 correct spelling in exception message --- .../main/java/org/sonar/server/rule/ws/RuleQueryFactory.java | 3 ++- .../java/org/sonar/server/rule/ws/RuleQueryFactoryTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java index 1d71266d0d4..33fa437903c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleQueryFactory.java @@ -36,6 +36,7 @@ import org.sonar.db.qualityprofile.QualityProfileDto; import org.sonar.server.rule.index.RuleQuery; import org.sonar.server.ws.WsUtils; +import static java.lang.String.format; import static org.sonar.server.util.EnumUtils.toEnums; import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVATION; import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVE_SEVERITIES; @@ -96,7 +97,7 @@ public class RuleQueryFactory { Optional organizationOptional = dbClient.organizationDao().selectByKey(dbSession, organizationKey); OrganizationDto organization = WsUtils.checkFoundWithOptional(organizationOptional, "No organization with key '%s'", organizationKey); if (!organizationUuid.equals(organization.getUuid())) { - throw new IllegalArgumentException(String.format("The specified qualityProfile '%s' is not part of the specified organization '%s'", qualityProfileKey, organizationKey)); + throw new IllegalArgumentException(format("The specified quality profile '%s' is not part of the specified organization '%s'", qualityProfileKey, organizationKey)); } } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleQueryFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleQueryFactoryTest.java index f69004eb2ad..28b45b6866e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleQueryFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleQueryFactoryTest.java @@ -229,7 +229,7 @@ public class RuleQueryFactoryTest { String organization2Key = organization2.getKey(); thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("The specified qualityProfile '" + qualityProfileKey + "' is not part of the specified organization '" + organization2Key + "'"); + thrown.expectMessage("The specified quality profile '" + qualityProfileKey + "' is not part of the specified organization '" + organization2Key + "'"); RuleQuery result = execute(PARAM_QPROFILE, qualityProfileKey, PARAM_ORGANIZATION, organization2Key); -- 2.39.5