private String title = null;
private String key = null;
- private String plugin = null;
+ private String repository = null;
private String description = null;
private String severity = null;
private List<RuleParam> params;
return this;
}
- public String getPlugin() {
- return plugin;
+ public String getRepository() {
+ return repository;
}
- public Rule setPlugin(String plugin) {
- this.plugin = plugin;
+ public Rule setRepository(String s) {
+ this.repository = s;
return this;
}
public static final String BASE_URL = "/api/rules";
private String language;
- private String[] plugins;
+ private String[] repositories;
private String searchText;
private String profile;
private String[] severities;
return language;
}
- public RuleQuery setPlugin(String... plugins) {
- this.plugins = plugins;
+ public RuleQuery setRepositories(String... s) {
+ this.repositories = s;
return this;
}
- public String[] getPlugins() {
- return plugins;
+ public String[] getRepositories() {
+ return repositories;
}
public RuleQuery setSearchText(String searchText) {
StringBuilder url = new StringBuilder(BASE_URL);
url.append('?');
appendUrlParameter(url, "language", language);
- appendUrlParameter(url, "plugins", plugins);
+ appendUrlParameter(url, "plugins", repositories);
appendUrlParameter(url, "searchtext", searchText);
appendUrlParameter(url, "profile", profile);
appendUrlParameter(url, "priorities", severities);
private void parseRuleFields(JSONObject json, Rule rule) {
rule.setTitle(JsonUtils.getString(json, "title"))
.setKey(JsonUtils.getString(json, "key"))
- .setPlugin(JsonUtils.getString(json, "plugin"))
+ .setRepository(JsonUtils.getString(json, "plugin"))
.setDescription(JsonUtils.getString(json, "description"))
.setSeverity(JsonUtils.getString(json, "priority"))
.setActive("ACTIVE".equals(JsonUtils.getString(json, "status")));
rule = rules.get(0);
assertThat(rule.getTitle(), is("Indentation"));
assertThat(rule.getKey(), is("checkstyle:com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck"));
- assertThat(rule.getPlugin(), is("checkstyle"));
+ assertThat(rule.getRepository(), is("checkstyle"));
assertThat(rule.getDescription(), is("Checks correct indentation of Java Code."));
assertThat(rule.getSeverity(), is("MINOR"));
assertThat(rule.isActive(), is(false));