]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7375 WS api/rules/search rename PARAM_KEY to PARAM_RULE_KEY
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 18 Mar 2016 15:21:56 +0000 (16:21 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 18 Mar 2016 17:09:35 +0000 (18:09 +0100)
server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/SearchActionMediumTest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/rule/RulesService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/rule/RulesWsParameters.java
sonar-ws/src/test/java/org/sonarqube/ws/client/rule/RulesServiceTest.java

index 59fa192768791238d9de5b1c96bd224faa98068a..de8b5c54defd7fd49dff56ec0cf90169c801baad 100644 (file)
@@ -79,7 +79,7 @@ import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVE_SEVERI
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_AVAILABLE_SINCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_INHERITANCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_IS_TEMPLATE;
-import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_KEY;
+import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_RULE_KEY;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_LANGUAGES;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_QPROFILE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_REPOSITORIES;
@@ -212,7 +212,7 @@ public class SearchAction implements RulesWsAction {
       .setExampleValue("xpath");
 
     action
-      .createParam(PARAM_KEY)
+      .createParam(PARAM_RULE_KEY)
       .setDescription("Key of rule to search for")
       .setExampleValue("squid:S001");
 
@@ -321,7 +321,7 @@ public class SearchAction implements RulesWsAction {
     query.setIsTemplate(request.paramAsBoolean(PARAM_IS_TEMPLATE));
     query.setTemplateKey(request.param(PARAM_TEMPLATE_KEY));
     query.setTypes(request.paramAsEnums(PARAM_TYPES, RuleType.class));
-    query.setKey(request.param(PARAM_KEY));
+    query.setKey(request.param(PARAM_RULE_KEY));
 
     String sortParam = request.param(Param.SORT);
     if (sortParam != null) {
index 76d558ff0fb418244aac1d27ac46aeaafa045b3c..52075e11499193d3b7be945ed0fee83e2731bb6c 100644 (file)
@@ -58,7 +58,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVATION;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_AVAILABLE_SINCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_IS_TEMPLATE;
-import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_KEY;
+import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_RULE_KEY;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_QPROFILE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_STATUSES;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_TAGS;
@@ -116,13 +116,13 @@ public class SearchActionMediumTest {
     ruleIndexer.index();
 
     WsTester.TestRequest request = tester.wsTester().newGetRequest(API_ENDPOINT, API_SEARCH_METHOD);
-    request.setParam(PARAM_KEY, RuleTesting.XOO_X1.toString());
+    request.setParam(PARAM_RULE_KEY, RuleTesting.XOO_X1.toString());
     request.setParam(WebService.Param.FIELDS, "actives");
     WsTester.Result result = request.execute();
     result.assertJson("{\"total\":1,\"p\":1,\"ps\":100,\"rules\":[{\"key\":\"xoo:x1\"}]}");
 
     request = tester.wsTester().newGetRequest(API_ENDPOINT, API_SEARCH_METHOD);
-    request.setParam(PARAM_KEY, RuleKey.of("xoo", "unknown").toString());
+    request.setParam(PARAM_RULE_KEY, RuleKey.of("xoo", "unknown").toString());
     request.setParam(WebService.Param.FIELDS, "actives");
     result = request.execute();
     result.assertJson("{\"total\":0,\"p\":1,\"ps\":100,\"rules\":[],\"actives\":{}}");
index 4dcbdf521e279e60b929d4c2eb740f12f0079c9e..3fa569bfcca1b62752033477b561a3fdcac6e892 100644 (file)
@@ -30,7 +30,7 @@ import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVE_SEVERI
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_AVAILABLE_SINCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_INHERITANCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_IS_TEMPLATE;
-import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_KEY;
+import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_RULE_KEY;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_LANGUAGES;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_QPROFILE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_REPOSITORIES;
@@ -63,7 +63,7 @@ public class RulesService extends BaseService {
         .setParam("q", request.getQuery())
         .setParam(PARAM_QPROFILE, request.getQProfile())
         .setParam(PARAM_REPOSITORIES, inlineMultipleParamValue(request.getRepositories()))
-        .setParam(PARAM_KEY, request.getRuleKey())
+        .setParam(PARAM_RULE_KEY, request.getRuleKey())
         .setParam("s", request.getSort())
         .setParam(PARAM_SEVERITIES, inlineMultipleParamValue(request.getSeverities()))
         .setParam(PARAM_STATUSES, inlineMultipleParamValue(request.getStatuses()))
index 3060d43fc505845e25550cd6ff824574de7c1403..e69b3d52e3d7180b0b522c3a581f0233bd95ba8a 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Set;
 
 public class RulesWsParameters {
   public static final String PARAM_REPOSITORIES = "repositories";
-  public static final String PARAM_KEY = "rule_key";
+  public static final String PARAM_RULE_KEY = "rule_key";
   public static final String PARAM_ACTIVATION = "activation";
   public static final String PARAM_QPROFILE = "qprofile";
   public static final String PARAM_SEVERITIES = "severities";
index d07af4d26ad37fa3e57d14174d11b2c25203cd45..211de126eb075a1ef4a67ba2726fd6739c050e54 100644 (file)
@@ -37,7 +37,7 @@ import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_ACTIVE_SEVERI
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_AVAILABLE_SINCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_INHERITANCE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_IS_TEMPLATE;
-import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_KEY;
+import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_RULE_KEY;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_LANGUAGES;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_QPROFILE;
 import static org.sonarqube.ws.client.rule.RulesWsParameters.PARAM_REPOSITORIES;
@@ -127,7 +127,7 @@ public class RulesServiceTest {
       .hasParam("q", QUERY_VALUE)
       .hasParam(PARAM_QPROFILE, QPROFILE_VALUE)
       .hasParam(PARAM_REPOSITORIES, REPOSITORIES_VALUE_INLINED)
-      .hasParam(PARAM_KEY, RULE_KEY_VALUE)
+      .hasParam(PARAM_RULE_KEY, RULE_KEY_VALUE)
       .hasParam(PARAM_LANGUAGES, LANGUAGES_VALUE_INLINED)
       .hasParam("s", SORT_VALUE)
       .hasParam(PARAM_SEVERITIES, SEVERITIES_VALUE_INLINED)