import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.metrics.sum.Sum;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_EFFORT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
public class Facets {
import org.sonar.server.search.QueryContext;
import org.sonar.server.user.UserSession;
import org.sonar.server.util.RubyUtils;
-import org.sonarqube.ws.client.issue.IssueFilterParameters;
+import org.sonarqube.ws.client.issue.IssuesWsParameters;
/**
* Used through ruby code <pre>Internal.issues</pre>
@VisibleForTesting
static SearchOptions toSearchOptions(Map<String, Object> props) {
SearchOptions options = new SearchOptions();
- Integer pageIndex = RubyUtils.toInteger(props.get(IssueFilterParameters.PAGE_INDEX));
- Integer pageSize = RubyUtils.toInteger(props.get(IssueFilterParameters.PAGE_SIZE));
+ Integer pageIndex = RubyUtils.toInteger(props.get(IssuesWsParameters.PAGE_INDEX));
+ Integer pageSize = RubyUtils.toInteger(props.get(IssuesWsParameters.PAGE_SIZE));
if (pageSize != null && pageSize < 0) {
options.setLimit(SearchOptions.MAX_LIMIT);
} else {
import org.sonar.server.rule.RuleKeyFunctions;
import org.sonar.server.user.UserSession;
import org.sonar.server.util.RubyUtils;
-import org.sonarqube.ws.client.issue.IssueFilterParameters;
+import org.sonarqube.ws.client.issue.IssuesWsParameters;
import org.sonarqube.ws.client.issue.SearchWsRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static org.sonar.db.component.ComponentDtoFunctions.toProjectUuid;
import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_KEYS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AFTER;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_IN_LAST;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SINCE_LEAK_PERIOD;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_KEYS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_ROOTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AFTER;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_IN_LAST;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SINCE_LEAK_PERIOD;
/**
* This component is used to create an IssueQuery, in order to transform the component and component roots keys into uuid.
try {
IssueQuery.Builder builder = IssueQuery.builder(userSession)
- .issueKeys(RubyUtils.toStrings(params.get(IssueFilterParameters.ISSUES)))
- .severities(RubyUtils.toStrings(params.get(IssueFilterParameters.SEVERITIES)))
- .statuses(RubyUtils.toStrings(params.get(IssueFilterParameters.STATUSES)))
- .resolutions(RubyUtils.toStrings(params.get(IssueFilterParameters.RESOLUTIONS)))
- .resolved(RubyUtils.toBoolean(params.get(IssueFilterParameters.RESOLVED)))
- .rules(toRules(params.get(IssueFilterParameters.RULES)))
- .assignees(buildAssignees(RubyUtils.toStrings(params.get(IssueFilterParameters.ASSIGNEES))))
- .languages(RubyUtils.toStrings(params.get(IssueFilterParameters.LANGUAGES)))
- .tags(RubyUtils.toStrings(params.get(IssueFilterParameters.TAGS)))
- .types(RubyUtils.toStrings(params.get(IssueFilterParameters.TYPES)))
- .assigned(RubyUtils.toBoolean(params.get(IssueFilterParameters.ASSIGNED)))
- .hideRules(RubyUtils.toBoolean(params.get(IssueFilterParameters.HIDE_RULES)))
- .createdAt(RubyUtils.toDate(params.get(IssueFilterParameters.CREATED_AT)))
+ .issueKeys(RubyUtils.toStrings(params.get(IssuesWsParameters.ISSUES)))
+ .severities(RubyUtils.toStrings(params.get(IssuesWsParameters.SEVERITIES)))
+ .statuses(RubyUtils.toStrings(params.get(IssuesWsParameters.STATUSES)))
+ .resolutions(RubyUtils.toStrings(params.get(IssuesWsParameters.RESOLUTIONS)))
+ .resolved(RubyUtils.toBoolean(params.get(IssuesWsParameters.RESOLVED)))
+ .rules(toRules(params.get(IssuesWsParameters.RULES)))
+ .assignees(buildAssignees(RubyUtils.toStrings(params.get(IssuesWsParameters.ASSIGNEES))))
+ .languages(RubyUtils.toStrings(params.get(IssuesWsParameters.LANGUAGES)))
+ .tags(RubyUtils.toStrings(params.get(IssuesWsParameters.TAGS)))
+ .types(RubyUtils.toStrings(params.get(IssuesWsParameters.TYPES)))
+ .assigned(RubyUtils.toBoolean(params.get(IssuesWsParameters.ASSIGNED)))
+ .hideRules(RubyUtils.toBoolean(params.get(IssuesWsParameters.HIDE_RULES)))
+ .createdAt(RubyUtils.toDate(params.get(IssuesWsParameters.CREATED_AT)))
.createdAfter(buildCreatedAfterFromDates(RubyUtils.toDate(params.get(CREATED_AFTER)), (String) params.get(CREATED_IN_LAST)))
- .createdBefore(RubyUtils.toDate(parseEndingDateOrDateTime((String) params.get(IssueFilterParameters.CREATED_BEFORE))));
+ .createdBefore(RubyUtils.toDate(parseEndingDateOrDateTime((String) params.get(IssuesWsParameters.CREATED_BEFORE))));
Set<String> allComponentUuids = Sets.newHashSet();
boolean effectiveOnComponentOnly = mergeDeprecatedComponentParameters(session,
- RubyUtils.toBoolean(params.get(IssueFilterParameters.ON_COMPONENT_ONLY)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.COMPONENTS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.COMPONENT_UUIDS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.COMPONENT_KEYS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.COMPONENT_ROOT_UUIDS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.COMPONENT_ROOTS)),
+ RubyUtils.toBoolean(params.get(IssuesWsParameters.ON_COMPONENT_ONLY)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.COMPONENTS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.COMPONENT_UUIDS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.COMPONENT_KEYS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.COMPONENT_ROOT_UUIDS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.COMPONENT_ROOTS)),
allComponentUuids);
addComponentParameters(builder, session,
effectiveOnComponentOnly,
allComponentUuids,
- RubyUtils.toStrings(params.get(IssueFilterParameters.PROJECT_UUIDS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.PROJECT_UUIDS)),
RubyUtils.toStrings(
ObjectUtils.defaultIfNull(
- params.get(IssueFilterParameters.PROJECT_KEYS),
- params.get(IssueFilterParameters.PROJECTS))),
- RubyUtils.toStrings(params.get(IssueFilterParameters.MODULE_UUIDS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.DIRECTORIES)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.FILE_UUIDS)),
- RubyUtils.toStrings(params.get(IssueFilterParameters.AUTHORS)));
-
- String sort = (String) params.get(IssueFilterParameters.SORT);
+ params.get(IssuesWsParameters.PROJECT_KEYS),
+ params.get(IssuesWsParameters.PROJECTS))),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.MODULE_UUIDS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.DIRECTORIES)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.FILE_UUIDS)),
+ RubyUtils.toStrings(params.get(IssuesWsParameters.AUTHORS)));
+
+ String sort = (String) params.get(IssuesWsParameters.SORT);
if (!Strings.isNullOrEmpty(sort)) {
builder.sort(sort);
- builder.asc(RubyUtils.toBoolean(params.get(IssueFilterParameters.ASC)));
+ builder.asc(RubyUtils.toBoolean(params.get(IssuesWsParameters.ASC)));
}
- String facetMode = (String) params.get(IssueFilterParameters.FACET_MODE);
+ String facetMode = (String) params.get(IssuesWsParameters.FACET_MODE);
if (!Strings.isNullOrEmpty(facetMode)) {
builder.facetMode(facetMode);
} else {
- builder.facetMode(IssueFilterParameters.FACET_MODE_COUNT);
+ builder.facetMode(IssuesWsParameters.FACET_MODE_COUNT);
}
return builder.build();
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.index.query.QueryBuilders.termsQuery;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNEES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.AUTHORS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_ACTION_PLANS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_FACET_MODE_DEBT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DIRECTORIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_ASSIGNED_TO_ME;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_EFFORT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FILE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.LANGUAGES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.MODULE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.REPORTERS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SEVERITIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.STATUSES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TAGS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TYPES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASSIGNEES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.AUTHORS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_ACTION_PLANS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_FACET_MODE_DEBT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DIRECTORIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_ASSIGNED_TO_ME;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FILE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.LANGUAGES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.MODULE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.REPORTERS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RESOLUTIONS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RULES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SEVERITIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.STATUSES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TAGS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TYPES;
/**
* The unique entry-point to interact with Elasticsearch index "issues".
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.io.Resources;
+import java.util.Map;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.issue.IssueQuery;
import org.sonar.server.issue.IssueQueryService;
import org.sonar.server.issue.IssueService;
-import org.sonarqube.ws.client.issue.IssueFilterParameters;
-
-import java.util.Map;
+import org.sonarqube.ws.client.issue.IssuesWsParameters;
/**
* List issue tags matching a given query.
@Override
public void handle(Request request, Response response) throws Exception {
Builder<String, Object> paramBuilder = ImmutableMap.<String, Object>builder()
- .put(IssueFilterParameters.COMPONENT_UUIDS, request.mandatoryParam(PARAM_COMPONENT_UUID))
- .put(IssueFilterParameters.RESOLVED, false);
+ .put(IssuesWsParameters.COMPONENT_UUIDS, request.mandatoryParam(PARAM_COMPONENT_UUID))
+ .put(IssuesWsParameters.RESOLVED, false);
if (request.hasParam(PARAM_CREATED_AT)) {
- paramBuilder.put(IssueFilterParameters.CREATED_AFTER, request.param(PARAM_CREATED_AT));
+ paramBuilder.put(IssuesWsParameters.CREATED_AFTER, request.param(PARAM_CREATED_AT));
}
IssueQuery query = queryService.createFromMap(paramBuilder.build());
int pageSize = request.mandatoryParamAsInt(PARAM_PAGE_SIZE);
import static org.sonar.server.es.SearchOptions.MAX_LIMIT;
import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ADDITIONAL_FIELDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASC;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNED;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNEES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.AUTHORS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_KEYS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AFTER;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_BEFORE;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_IN_LAST;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_ACTION_PLANS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_FACET_MODE_DEBT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DIRECTORIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_ASSIGNED_TO_ME;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_COUNT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_EFFORT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FILE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ISSUES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.LANGUAGES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.MODULE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ON_COMPONENT_ONLY;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PLANNED;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_KEYS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLVED;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SEVERITIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SINCE_LEAK_PERIOD;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.STATUSES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TAGS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TYPES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ADDITIONAL_FIELDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASC;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASSIGNED;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASSIGNEES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.AUTHORS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_KEYS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_ROOTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_ROOT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AFTER;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_BEFORE;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_IN_LAST;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_ACTION_PLANS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_FACET_MODE_DEBT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DIRECTORIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_ASSIGNED_TO_ME;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_COUNT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FILE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ISSUES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.LANGUAGES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.MODULE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ON_COMPONENT_ONLY;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PLANNED;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECT_KEYS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RESOLUTIONS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RESOLVED;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RULES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SEVERITIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SINCE_LEAK_PERIOD;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.STATUSES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TAGS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TYPES;
public class SearchAction implements IssuesWsAction {
import org.sonar.server.issue.ActionService;
import org.sonar.server.issue.IssueCommentService;
import org.sonar.server.issue.IssueService;
-import org.sonarqube.ws.client.issue.IssueFilterParameters;
+import org.sonarqube.ws.client.issue.IssuesWsParameters;
import static com.google.common.collect.Lists.newArrayList;
import static org.sonar.server.issue.ws.SearchAdditionalField.ACTIONS;
private void completeTotalEffortFromFacet(@Nullable Facets facets, SearchResponseData result) {
if (facets != null) {
- Map<String, Long> effortFacet = facets.get(IssueFilterParameters.FACET_MODE_EFFORT);
+ Map<String, Long> effortFacet = facets.get(IssuesWsParameters.FACET_MODE_EFFORT);
if (effortFacet != null) {
result.setEffortTotal(effortFacet.get(Facets.TOTAL));
}
import static org.assertj.core.api.Assertions.entry;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_FACET_MODE_DEBT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_EFFORT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_FACET_MODE_DEBT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
public class IssueIndexDebtTest {
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.Issues.SearchWsResponse;
import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.client.issue.IssueFilterParameters;
+import org.sonarqube.ws.client.issue.IssuesWsParameters;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Arrays.asList;
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.PROJECT_UUIDS, project.uuid())
+ .setParam(IssuesWsParameters.PROJECT_UUIDS, project.uuid())
.execute()
.assertJson(this.getClass(), "search_by_project_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.PROJECT_UUIDS, "unknown")
+ .setParam(IssuesWsParameters.PROJECT_UUIDS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, project.uuid())
.execute()
.assertJson(this.getClass(), "search_by_project_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown")
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid())
- .setParam(IssueFilterParameters.SINCE_LEAK_PERIOD, "true")
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, project.uuid())
+ .setParam(IssuesWsParameters.SINCE_LEAK_PERIOD, "true")
.execute()
.assertJson(this.getClass(), "search_since_leak_period.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid())
- .setParam(IssueFilterParameters.FILE_UUIDS, file.uuid())
- .setParam(IssueFilterParameters.SINCE_LEAK_PERIOD, "true")
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, project.uuid())
+ .setParam(IssuesWsParameters.FILE_UUIDS, file.uuid())
+ .setParam(IssuesWsParameters.SINCE_LEAK_PERIOD, "true")
.execute()
.assertJson(this.getClass(), "search_since_leak_period.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.PROJECT_UUIDS, project1.uuid())
+ .setParam(IssuesWsParameters.PROJECT_UUIDS, project1.uuid())
.setParam(WebService.Param.FACETS, "projectUuids")
.execute()
.assertJson(this.getClass(), "display_sticky_project_facet.json");
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.FILE_UUIDS, file.uuid())
+ .setParam(IssuesWsParameters.FILE_UUIDS, file.uuid())
.execute()
.assertJson(this.getClass(), "search_by_file_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.FILE_UUIDS, "unknown")
+ .setParam(IssuesWsParameters.FILE_UUIDS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, file.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, file.uuid())
.execute()
.assertJson(this.getClass(), "search_by_file_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown")
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENTS, file.key())
+ .setParam(IssuesWsParameters.COMPONENTS, file.key())
.execute()
.assertJson(this.getClass(), "search_by_file_key.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENTS, unitTest.key())
+ .setParam(IssuesWsParameters.COMPONENTS, unitTest.key())
.execute()
.assertJson(this.getClass(), "search_by_test_key.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid())
- .setParam(IssueFilterParameters.FILE_UUIDS, file1.uuid() + "," + file3.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, project.uuid())
+ .setParam(IssuesWsParameters.FILE_UUIDS, file1.uuid() + "," + file3.uuid())
.setParam(WebService.Param.FACETS, "fileUuids")
.execute()
.assertJson(this.getClass(), "display_file_facet.json");
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, directory.uuid())
.execute()
.assertJson(this.getClass(), "search_by_file_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown")
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir")
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java/dir")
.execute()
.assertJson(this.getClass(), "search_by_file_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java")
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java")
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory1.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, directory1.uuid())
.execute()
.assertJson(this.getClass(), "search_by_directory_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory2.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, directory2.uuid())
.execute()
.assertJson(this.getClass(), "no_issue.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.MODULE_UUIDS, module1.uuid())
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir")
+ .setParam(IssuesWsParameters.MODULE_UUIDS, module1.uuid())
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java/dir")
.execute()
.assertJson(this.getClass(), "search_by_directory_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.MODULE_UUIDS, module2.uuid())
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir")
+ .setParam(IssuesWsParameters.MODULE_UUIDS, module2.uuid())
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java/dir")
.execute()
.assertJson(this.getClass(), "no_issue.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir")
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java/dir")
.execute()
.assertJson(this.getClass(), "search_by_directory_uuid.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java")
+ .setParam(IssuesWsParameters.DIRECTORIES, "src/main/java")
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, module.uuid())
- .setParam(IssueFilterParameters.MODULE_UUIDS, subModule1.uuid() + "," + subModule3.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, module.uuid())
+ .setParam(IssuesWsParameters.MODULE_UUIDS, subModule1.uuid() + "," + subModule3.uuid())
.setParam(WebService.Param.FACETS, "moduleUuids")
.execute()
.assertJson(this.getClass(), "display_module_facet.json");
userSessionRule.login("john").addProjectUuidPermissions(UserRole.USER, view.uuid());
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, view.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, view.uuid())
.execute()
.assertJson(this.getClass(), "search_by_view_uuid.json");
}
userSessionRule.login("john").addProjectUuidPermissions(UserRole.CODEVIEWER, view.uuid());
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, view.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, view.uuid())
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
userSessionRule.login("john").addComponentUuidPermission(UserRole.USER, view.uuid(), subView.uuid());
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, subView.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, subView.uuid())
.execute()
.assertJson(this.getClass(), "search_by_view_uuid.json");
}
userSessionRule.login("john").addComponentUuidPermission(UserRole.CODEVIEWER, view.uuid(), subView.uuid());
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, subView.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, subView.uuid())
.execute()
.assertJson(this.getClass(), "no_issue.json");
}
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.AUTHORS, "leia")
+ .setParam(IssuesWsParameters.AUTHORS, "leia")
.setParam(WebService.Param.FACETS, "authors")
.execute()
.assertJson(this.getClass(), "search_by_authors.json");
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.AUTHORS, "unknown")
+ .setParam(IssuesWsParameters.AUTHORS, "unknown")
.execute()
.assertJson(this.getClass(), "no_issue.json");
tester.get(IssueIndexer.class).indexAll();
wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, developer.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, developer.uuid())
.execute()
.assertJson(this.getClass(), "search_by_developer.json");
}
tester.get(IssueIndexer.class).indexAll();
Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
- .setParam(IssueFilterParameters.COMPONENT_UUIDS, technicalProject.uuid())
+ .setParam(IssuesWsParameters.COMPONENT_UUIDS, technicalProject.uuid())
.execute();
result
.assertJson(this.getClass(), "search_by_developer.json");
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.issue.ws.IssuesWs.API_ENDPOINT;
import static org.sonar.server.issue.ws.SearchAction.SEARCH_ACTION;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ADDITIONAL_FIELDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AFTER;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_FACET_MODE_DEBT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE_EFFORT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.HIDE_COMMENTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PAGE_INDEX;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PAGE_SIZE;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ADDITIONAL_FIELDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AFTER;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_FACET_MODE_DEBT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_EFFORT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.HIDE_COMMENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PAGE_INDEX;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PAGE_SIZE;
public class SearchActionMediumTest {
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonarqube.ws.client.issue;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import java.util.List;
-
-/**
- * @since 5.3
- */
-public class IssueFilterParameters {
-
- public static final String ISSUES = "issues";
- public static final String SEVERITIES = "severities";
- public static final String STATUSES = "statuses";
- public static final String RESOLUTIONS = "resolutions";
- public static final String RESOLVED = "resolved";
- public static final String COMPONENTS = "components";
- public static final String COMPONENT_KEYS = "componentKeys";
- public static final String COMPONENT_UUIDS = "componentUuids";
- public static final String COMPONENT_ROOTS = "componentRoots";
- public static final String COMPONENT_ROOT_UUIDS = "componentRootUuids";
- public static final String MODULE_UUIDS = "moduleUuids";
- public static final String PROJECTS = "projects";
- public static final String PROJECT_KEYS = "projectKeys";
- public static final String PROJECT_UUIDS = "projectUuids";
- public static final String DIRECTORIES = "directories";
- public static final String FILE_UUIDS = "fileUuids";
- public static final String ON_COMPONENT_ONLY = "onComponentOnly";
- public static final String RULES = "rules";
-
- /**
- * @deprecated since 5.5, action plan feature has been removed
- */
- @Deprecated
- public static final String DEPRECATED_ACTION_PLANS = "actionPlans";
-
- /**
- * @deprecated since 5.5, manual issue feature has been dropped.
- */
- @Deprecated
- public static final String REPORTERS = "reporters";
- public static final String ASSIGNEES = "assignees";
- public static final String AUTHORS = "authors";
- public static final String LANGUAGES = "languages";
- public static final String TAGS = "tags";
- public static final String TYPES = "types";
- public static final String ASSIGNED = "assigned";
-
- /**
- * @deprecated since 5.5, action plan feature has been removed
- */
- @Deprecated
- public static final String PLANNED = "planned";
- public static final String HIDE_RULES = "hideRules";
- public static final String HIDE_COMMENTS = "hideComments";
- public static final String CREATED_AFTER = "createdAfter";
- public static final String CREATED_AT = "createdAt";
- public static final String CREATED_BEFORE = "createdBefore";
- public static final String CREATED_IN_LAST = "createdInLast";
- public static final String SINCE_LEAK_PERIOD = "sinceLeakPeriod";
- public static final String PAGE_SIZE = "pageSize";
- public static final String PAGE_INDEX = "pageIndex";
- public static final String SORT = "sort";
- public static final String ASC = "asc";
- public static final String ADDITIONAL_FIELDS = "additionalFields";
-
- public static final String FACET_MODE = "facetMode";
- public static final String FACET_MODE_COUNT = "count";
-
- /**
- * @deprecated since 5.5, replaced by {@link #FACET_MODE_EFFORT}
- */
- @Deprecated
- public static final String DEPRECATED_FACET_MODE_DEBT = "debt";
- public static final String FACET_MODE_EFFORT = "effort";
-
- public static final String FACET_ASSIGNED_TO_ME = "assigned_to_me";
-
- public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED,
- COMPONENTS, COMPONENT_ROOTS, RULES, DEPRECATED_ACTION_PLANS, REPORTERS, TAGS, TYPES,
- ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST,
- COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE,
- PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS,
- HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
-
- public static final List<String> ALL_WITHOUT_PAGINATION = ImmutableList.copyOf(Iterables.filter(ALL, new Predicate<String>() {
- @Override
- public boolean apply(String input) {
- return !PAGE_INDEX.equals(input) && !PAGE_SIZE.equals(input);
- }
- }));
-
- private IssueFilterParameters() {
- // Utility class
- }
-}
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsConnector;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ADDITIONAL_FIELDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASC;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNED;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNEES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.AUTHORS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_KEYS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AFTER;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AT;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_BEFORE;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_IN_LAST;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DEPRECATED_ACTION_PLANS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.DIRECTORIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.FILE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ISSUES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.LANGUAGES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.MODULE_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.ON_COMPONENT_ONLY;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECTS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_KEYS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLVED;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SEVERITIES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.SINCE_LEAK_PERIOD;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.STATUSES;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TAGS;
-import static org.sonarqube.ws.client.issue.IssueFilterParameters.TYPES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ADDITIONAL_FIELDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASC;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASSIGNED;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ASSIGNEES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.AUTHORS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_KEYS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_ROOTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_ROOT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.COMPONENT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AFTER;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_AT;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_BEFORE;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.CREATED_IN_LAST;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_ACTION_PLANS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.DIRECTORIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.FILE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ISSUES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.LANGUAGES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.MODULE_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.ON_COMPONENT_ONLY;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECT_KEYS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PROJECT_UUIDS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RESOLUTIONS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RESOLVED;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.RULES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SEVERITIES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.SINCE_LEAK_PERIOD;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.STATUSES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TAGS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.TYPES;
public class IssuesService extends BaseService {
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.issue;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import java.util.List;
+
+/**
+ * @since 5.3
+ */
+public class IssuesWsParameters {
+
+ public static final String ISSUES = "issues";
+ public static final String SEVERITIES = "severities";
+ public static final String STATUSES = "statuses";
+ public static final String RESOLUTIONS = "resolutions";
+ public static final String RESOLVED = "resolved";
+ public static final String COMPONENTS = "components";
+ public static final String COMPONENT_KEYS = "componentKeys";
+ public static final String COMPONENT_UUIDS = "componentUuids";
+ public static final String COMPONENT_ROOTS = "componentRoots";
+ public static final String COMPONENT_ROOT_UUIDS = "componentRootUuids";
+ public static final String MODULE_UUIDS = "moduleUuids";
+ public static final String PROJECTS = "projects";
+ public static final String PROJECT_KEYS = "projectKeys";
+ public static final String PROJECT_UUIDS = "projectUuids";
+ public static final String DIRECTORIES = "directories";
+ public static final String FILE_UUIDS = "fileUuids";
+ public static final String ON_COMPONENT_ONLY = "onComponentOnly";
+ public static final String RULES = "rules";
+
+ /**
+ * @deprecated since 5.5, action plan feature has been removed
+ */
+ @Deprecated
+ public static final String DEPRECATED_ACTION_PLANS = "actionPlans";
+
+ /**
+ * @deprecated since 5.5, manual issue feature has been dropped.
+ */
+ @Deprecated
+ public static final String REPORTERS = "reporters";
+ public static final String ASSIGNEES = "assignees";
+ public static final String AUTHORS = "authors";
+ public static final String LANGUAGES = "languages";
+ public static final String TAGS = "tags";
+ public static final String TYPES = "types";
+ public static final String ASSIGNED = "assigned";
+
+ /**
+ * @deprecated since 5.5, action plan feature has been removed
+ */
+ @Deprecated
+ public static final String PLANNED = "planned";
+ public static final String HIDE_RULES = "hideRules";
+ public static final String HIDE_COMMENTS = "hideComments";
+ public static final String CREATED_AFTER = "createdAfter";
+ public static final String CREATED_AT = "createdAt";
+ public static final String CREATED_BEFORE = "createdBefore";
+ public static final String CREATED_IN_LAST = "createdInLast";
+ public static final String SINCE_LEAK_PERIOD = "sinceLeakPeriod";
+ public static final String PAGE_SIZE = "pageSize";
+ public static final String PAGE_INDEX = "pageIndex";
+ public static final String SORT = "sort";
+ public static final String ASC = "asc";
+ public static final String ADDITIONAL_FIELDS = "additionalFields";
+
+ public static final String FACET_MODE = "facetMode";
+ public static final String FACET_MODE_COUNT = "count";
+
+ /**
+ * @deprecated since 5.5, replaced by {@link #FACET_MODE_EFFORT}
+ */
+ @Deprecated
+ public static final String DEPRECATED_FACET_MODE_DEBT = "debt";
+ public static final String FACET_MODE_EFFORT = "effort";
+
+ public static final String FACET_ASSIGNED_TO_ME = "assigned_to_me";
+
+ public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED,
+ COMPONENTS, COMPONENT_ROOTS, RULES, DEPRECATED_ACTION_PLANS, REPORTERS, TAGS, TYPES,
+ ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST,
+ COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE,
+ PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS,
+ HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
+
+ public static final List<String> ALL_WITHOUT_PAGINATION = ImmutableList.copyOf(Iterables.filter(ALL, new Predicate<String>() {
+ @Override
+ public boolean apply(String input) {
+ return !PAGE_INDEX.equals(input) && !PAGE_SIZE.equals(input);
+ }
+ }));
+
+ private IssuesWsParameters() {
+ // Utility class
+ }
+}