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;
.setExampleValue("xpath");
action
- .createParam(PARAM_KEY)
+ .createParam(PARAM_RULE_KEY)
.setDescription("Key of rule to search for")
.setExampleValue("squid:S001");
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) {
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;
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\":{}}");
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;
.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()))
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";
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;
.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)