import org.sonarqube.ws.Users;
import org.sonarqube.ws.client.HttpException;
import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.organization.CreateWsRequest;
+import org.sonarqube.ws.client.organization.CreateRequest;
import org.sonarqube.ws.client.organization.OrganizationService;
-import org.sonarqube.ws.client.organization.SearchMembersWsRequest;
-import org.sonarqube.ws.client.organization.SearchWsRequest;
+import org.sonarqube.ws.client.organization.SearchMembersRequest;
+import org.sonarqube.ws.client.organization.SearchRequest;
import org.sonarqube.ws.client.user.GroupsRequest;
import static java.util.Arrays.stream;
}
void deleteNonGuardedOrganizations() {
- service().search(SearchWsRequest.builder().build()).getOrganizationsList()
+ service().search(SearchRequest.builder().build()).getOrganizationsList()
.stream()
.filter(o -> !o.getKey().equals("default-organization"))
.forEach(organization -> service().delete(organization.getKey()));
}
@SafeVarargs
- public final Organizations.Organization generate(Consumer<CreateWsRequest.Builder>... populators) {
+ public final Organizations.Organization generate(Consumer<CreateRequest.Builder>... populators) {
int id = ID_GENERATOR.getAndIncrement();
- CreateWsRequest.Builder request = new CreateWsRequest.Builder()
+ CreateRequest.Builder request = new CreateRequest.Builder()
.setKey("org" + id)
.setName("Org " + id)
.setDescription("Description " + id)
}
public Organizations.Organization getDefaultOrganization() {
- return service().search(SearchWsRequest.builder().build()).getOrganizationsList()
+ return service().search(SearchRequest.builder().build()).getOrganizationsList()
.stream()
.filter(o -> o.getKey().equals("default-organization"))
.findFirst().orElseThrow(() -> new IllegalStateException("Can't find default organization"));
}
public OrganizationTester assertThatOrganizationDoesNotExist(String organizationKey) {
- SearchWsRequest request = new SearchWsRequest.Builder().setOrganizations(organizationKey).build();
+ SearchRequest request = new SearchRequest.Builder().setOrganizations(organizationKey).build();
Organizations.SearchWsResponse searchWsResponse = service().search(request);
Assertions.assertThat(searchWsResponse.getOrganizationsList()).isEmpty();
return this;
}
private void verifyOrganizationMembership(@Nullable Organizations.Organization organization, String userLogin, boolean isMember) {
- List<Organizations.User> users = service().searchMembers(new SearchMembersWsRequest()
+ List<Organizations.User> users = service().searchMembers(new SearchMembersRequest()
.setQuery(userLogin)
.setSelected("selected")
.setOrganization(organization != null ? organization.getKey() : null))
import org.sonarqube.ws.client.project.CreateRequest;
import org.sonarqube.ws.client.project.DeleteRequest;
import org.sonarqube.ws.client.project.ProjectsService;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static java.util.Arrays.stream;
import static java.util.Collections.singletonList;
void deleteAll() {
ProjectsService service = session.wsClient().projects();
- service.search(SearchWsRequest.builder().setQualifiers(singletonList("TRK")).build()).getComponentsList().forEach(p ->
+ service.search(SearchRequest.builder().setQualifiers(singletonList("TRK")).build()).getComponentsList().forEach(p ->
service.delete(DeleteRequest.builder().setKey(p.getKey()).build()));
}
import org.sonarqube.ws.Rules;
import org.sonarqube.ws.Projects.CreateWsResponse.Project;
import org.sonarqube.ws.client.HttpException;
-import org.sonarqube.ws.client.qualityprofile.ActivateRuleWsRequest;
+import org.sonarqube.ws.client.qualityprofile.ActivateRuleRequest;
import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
import org.sonarqube.ws.client.qualityprofile.CreateRequest;
import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
}
public QProfileTester activateRule(String profileKey, String ruleKey) {
- ActivateRuleWsRequest request = ActivateRuleWsRequest.builder()
+ ActivateRuleRequest request = ActivateRuleRequest.builder()
.setKey(profileKey)
.setRuleKey(ruleKey)
.build();
@SafeVarargs
public final User generateAdministrator(Consumer<CreateRequest.Builder>... populators) {
User user = generate(populators);
- session.wsClient().permissions().addUser(new org.sonarqube.ws.client.permission.AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin"));
+ session.wsClient().permissions().addUser(new org.sonarqube.ws.client.permission.AddUserRequest().setLogin(user.getLogin()).setPermission("admin"));
session.wsClient().userGroups().addUser(new AddUserRequest().setLogin(user.getLogin()).setName("sonar-administrators"));
return user;
}
import org.sonar.server.ws.WsUtils;
import org.sonarqube.ws.Components;
import org.sonarqube.ws.Components.SearchWsResponse;
-import org.sonarqube.ws.client.component.SearchWsRequest;
+import org.sonarqube.ws.client.component.SearchRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.stream.Collectors.toMap;
writeProtobuf(searchWsResponse, wsRequest, wsResponse);
}
- private static SearchWsRequest toSearchWsRequest(Request request) {
- return new SearchWsRequest()
+ private static SearchRequest toSearchWsRequest(Request request) {
+ return new SearchRequest()
.setOrganization(request.param(PARAM_ORGANIZATION))
.setQualifiers(request.mandatoryParamAsStrings(PARAM_QUALIFIERS))
.setLanguage(request.param(PARAM_LANGUAGE))
.setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE));
}
- private SearchWsResponse doHandle(SearchWsRequest request) {
+ private SearchWsResponse doHandle(SearchRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto organization = getOrganization(dbSession, request);
ComponentQuery esQuery = buildEsQuery(organization, request);
return projects.stream().collect(toMap(ComponentDto::uuid, ComponentDto::getDbKey));
}
- private OrganizationDto getOrganization(DbSession dbSession, SearchWsRequest request) {
+ private OrganizationDto getOrganization(DbSession dbSession, SearchRequest request) {
String organizationKey = Optional.ofNullable(request.getOrganization())
.orElseGet(defaultOrganizationProvider.get()::getKey);
return WsUtils.checkFoundWithOptional(
"No organizationDto with key '%s'", organizationKey);
}
- private static ComponentQuery buildEsQuery(OrganizationDto organization, SearchWsRequest request) {
+ private static ComponentQuery buildEsQuery(OrganizationDto organization, SearchRequest request) {
return ComponentQuery.builder()
.setQuery(request.getQuery())
.setOrganization(organization.getUuid())
import org.sonar.server.component.ComponentFinder;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Components.ShowWsResponse;
-import org.sonarqube.ws.client.component.ShowWsRequest;
+import org.sonarqube.ws.client.component.ShowRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
@Override
public void handle(Request request, Response response) throws Exception {
- ShowWsRequest showWsRequest = toShowWsRequest(request);
- ShowWsResponse showWsResponse = doHandle(showWsRequest);
+ ShowRequest showRequest = toShowWsRequest(request);
+ ShowWsResponse showWsResponse = doHandle(showRequest);
writeProtobuf(showWsResponse, request, response);
}
- private ShowWsResponse doHandle(ShowWsRequest request) {
+ private ShowWsResponse doHandle(ShowRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
ComponentDto component = loadComponent(dbSession, request);
Optional<SnapshotDto> lastAnalysis = dbClient.snapshotDao().selectLastAnalysisByComponentUuid(dbSession, component.projectUuid());
}
}
- private ComponentDto loadComponent(DbSession dbSession, ShowWsRequest request) {
+ private ComponentDto loadComponent(DbSession dbSession, ShowRequest request) {
String componentId = request.getId();
String componentKey = request.getKey();
String branch = request.getBranch();
return response.build();
}
- private static ShowWsRequest toShowWsRequest(Request request) {
- return new ShowWsRequest()
+ private static ShowRequest toShowWsRequest(Request request) {
+ return new ShowRequest()
.setId(request.param(PARAM_COMPONENT_ID))
.setKey(request.param(PARAM_COMPONENT))
.setBranch(request.param(PARAM_BRANCH));
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Components;
import org.sonarqube.ws.Components.TreeWsResponse;
-import org.sonarqube.ws.client.component.TreeWsRequest;
+import org.sonarqube.ws.client.component.TreeRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.CASE_INSENSITIVE_ORDER;
writeProtobuf(treeWsResponse, request, response);
}
- private TreeWsResponse doHandle(TreeWsRequest treeWsRequest) {
+ private TreeWsResponse doHandle(TreeRequest treeRequest) {
try (DbSession dbSession = dbClient.openSession(false)) {
- ComponentDto baseComponent = loadComponent(dbSession, treeWsRequest);
+ ComponentDto baseComponent = loadComponent(dbSession, treeRequest);
checkPermissions(baseComponent);
OrganizationDto organizationDto = componentFinder.getOrganization(dbSession, baseComponent);
- ComponentTreeQuery query = toComponentTreeQuery(treeWsRequest, baseComponent);
+ ComponentTreeQuery query = toComponentTreeQuery(treeRequest, baseComponent);
List<ComponentDto> components = dbClient.componentDao().selectDescendants(dbSession, query);
int total = components.size();
- components = sortComponents(components, treeWsRequest);
- components = paginateComponents(components, treeWsRequest);
+ components = sortComponents(components, treeRequest);
+ components = paginateComponents(components, treeRequest);
Map<String, ComponentDto> referenceComponentsByUuid = searchReferenceComponentsByUuid(dbSession, components);
return buildResponse(baseComponent, organizationDto, components, referenceComponentsByUuid,
- Paging.forPageIndex(treeWsRequest.getPage()).withPageSize(treeWsRequest.getPageSize()).andTotal(total));
+ Paging.forPageIndex(treeRequest.getPage()).withPageSize(treeRequest.getPageSize()).andTotal(total));
}
}
- private ComponentDto loadComponent(DbSession dbSession, TreeWsRequest request) {
+ private ComponentDto loadComponent(DbSession dbSession, TreeRequest request) {
String componentId = request.getBaseComponentId();
String componentKey = request.getBaseComponentKey();
String branch = request.getBranch();
return wsComponent;
}
- private ComponentTreeQuery toComponentTreeQuery(TreeWsRequest request, ComponentDto baseComponent) {
+ private ComponentTreeQuery toComponentTreeQuery(TreeRequest request, ComponentDto baseComponent) {
List<String> childrenQualifiers = childrenQualifiers(request, baseComponent.qualifier());
ComponentTreeQuery.Builder query = ComponentTreeQuery.builder()
}
@CheckForNull
- private List<String> childrenQualifiers(TreeWsRequest request, String baseQualifier) {
+ private List<String> childrenQualifiers(TreeRequest request, String baseQualifier) {
List<String> requestQualifiers = request.getQualifiers();
List<String> childrenQualifiers = null;
if (LEAVES_STRATEGY.equals(request.getStrategy())) {
return new ArrayList<>(qualifiersIntersection);
}
- private static TreeWsRequest toTreeWsRequest(Request request) {
- return new TreeWsRequest()
+ private static TreeRequest toTreeWsRequest(Request request) {
+ return new TreeRequest()
.setBaseComponentId(request.param(PARAM_COMPONENT_ID))
.setBaseComponentKey(request.param(PARAM_COMPONENT))
.setBranch(request.param(PARAM_BRANCH))
.setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE));
}
- private static List<ComponentDto> paginateComponents(List<ComponentDto> components, TreeWsRequest wsRequest) {
+ private static List<ComponentDto> paginateComponents(List<ComponentDto> components, TreeRequest wsRequest) {
return components.stream().skip(offset(wsRequest.getPage(), wsRequest.getPageSize()))
.limit(wsRequest.getPageSize()).collect(toList());
}
- public static List<ComponentDto> sortComponents(List<ComponentDto> components, TreeWsRequest wsRequest) {
+ public static List<ComponentDto> sortComponents(List<ComponentDto> components, TreeRequest wsRequest) {
List<String> sortParameters = wsRequest.getSort();
if (sortParameters == null || sortParameters.isEmpty()) {
return components;
import org.sonar.db.component.SnapshotDto;
import org.sonar.db.organization.OrganizationDto;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Lists.newArrayList;
this.userSession = userSession;
}
- public IssueQuery create(SearchWsRequest request) {
+ public IssueQuery create(SearchRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
IssueQuery.Builder builder = IssueQuery.builder()
.issueKeys(request.getIssues())
return organization.map(OrganizationDto::getUuid).orElse(UNKNOWN);
}
- private Date buildCreatedAfterFromRequest(DbSession dbSession, SearchWsRequest request, List<ComponentDto> componentUuids) {
+ private Date buildCreatedAfterFromRequest(DbSession dbSession, SearchRequest request, List<ComponentDto> componentUuids) {
Date createdAfter = parseStartingDateOrDateTime(request.getCreatedAfter());
String createdInLast = request.getCreatedInLast();
return assignees;
}
- private boolean mergeDeprecatedComponentParameters(DbSession session, SearchWsRequest request, List<ComponentDto> allComponents) {
+ private boolean mergeDeprecatedComponentParameters(DbSession session, SearchRequest request, List<ComponentDto> allComponents) {
Boolean onComponentOnly = request.getOnComponentOnly();
Collection<String> components = request.getComponents();
Collection<String> componentUuids = request.getComponentUuids();
}
private void addComponentParameters(IssueQuery.Builder builder, DbSession session, boolean onComponentOnly,
- List<ComponentDto> components, SearchWsRequest request) {
+ List<ComponentDto> components, SearchRequest request) {
builder.onComponentOnly(onComponentOnly);
if (onComponentOnly) {
addComponentsBasedOnQualifier(builder, session, components, request);
}
- private void addComponentsBasedOnQualifier(IssueQuery.Builder builder, DbSession dbSession, List<ComponentDto> components, SearchWsRequest request) {
+ private void addComponentsBasedOnQualifier(IssueQuery.Builder builder, DbSession dbSession, List<ComponentDto> components, SearchRequest request) {
if (components.isEmpty()) {
return;
}
builder.viewUuids(filteredViewUuids);
}
- private void addApplications(IssueQuery.Builder builder, DbSession dbSession, List<ComponentDto> applications, SearchWsRequest request) {
+ private void addApplications(IssueQuery.Builder builder, DbSession dbSession, List<ComponentDto> applications, SearchRequest request) {
Set<String> authorizedApplicationUuids = applications.stream()
.filter(app -> userSession.hasComponentPermission(UserRole.USER, app))
.map(ComponentDto::uuid)
addCreatedAfterByProjects(builder, dbSession, request, authorizedApplicationUuids);
}
- private void addCreatedAfterByProjects(IssueQuery.Builder builder, DbSession dbSession, SearchWsRequest request, Set<String> applicationUuids) {
+ private void addCreatedAfterByProjects(IssueQuery.Builder builder, DbSession dbSession, SearchRequest request, Set<String> applicationUuids) {
if (request.getSinceLeakPeriod() == null || !request.getSinceLeakPeriod()) {
return;
}
import org.sonar.server.issue.IssueQuery;
import org.sonar.server.issue.IssueQueryFactory;
import org.sonar.server.issue.index.IssueIndex;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static java.util.Collections.singletonList;
import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
@Override
public void handle(Request request, Response response) throws Exception {
- SearchWsRequest searchWsRequest = new SearchWsRequest()
+ SearchRequest searchRequest = new SearchRequest()
.setComponentUuids(singletonList(request.mandatoryParam(PARAM_COMPONENT_UUID)))
.setResolved(false)
.setCreatedAfter(request.param(PARAM_CREATED_AFTER));
- IssueQuery query = queryService.create(searchWsRequest);
+ IssueQuery query = queryService.create(searchRequest);
int pageSize = request.mandatoryParamAsInt(PAGE_SIZE);
try (JsonWriter json = response.newJsonWriter()) {
json.beginObject().name("tags").beginArray();
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Issues.SearchWsResponse;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Iterables.concat;
writeProtobuf(searchWsResponse, request, response);
}
- private SearchWsResponse doHandle(SearchWsRequest request, Request wsRequest) {
+ private SearchWsResponse doHandle(SearchRequest request, Request wsRequest) {
// prepare the Elasticsearch request
SearchOptions options = createSearchOptionsFromRequest(request);
EnumSet<SearchAdditionalField> additionalFields = SearchAdditionalField.getFromRequest(request);
return searchResponseFormat.formatSearch(additionalFields, data, paging, facets);
}
- private static SearchOptions createSearchOptionsFromRequest(SearchWsRequest request) {
+ private static SearchOptions createSearchOptionsFromRequest(SearchRequest request) {
SearchOptions options = new SearchOptions();
options.setPage(request.getPage(), request.getPageSize());
options.addFacets(request.getFacets());
return new Facets(orderedFacets, system2.getDefaultTimeZone());
}
- private void completeFacets(Facets facets, SearchWsRequest request, Request wsRequest) {
+ private void completeFacets(Facets facets, SearchRequest request, Request wsRequest) {
addMandatoryValuesToFacet(facets, PARAM_SEVERITIES, Severity.ALL);
addMandatoryValuesToFacet(facets, PARAM_STATUSES, Issue.STATUSES);
addMandatoryValuesToFacet(facets, PARAM_RESOLUTIONS, concat(singletonList(""), Issue.RESOLUTIONS));
collector.addAll(SearchAdditionalField.USERS, facets.getBucketKeys(PARAM_ASSIGNEES));
}
- private static void collectRequestParams(SearchResponseLoader.Collector collector, SearchWsRequest request) {
+ private static void collectRequestParams(SearchResponseLoader.Collector collector, SearchRequest request) {
collector.addProjectUuids(request.getProjectUuids());
collector.addComponentUuids(request.getFileUuids());
collector.addComponentUuids(request.getModuleUuids());
collector.addAll(SearchAdditionalField.USERS, request.getAssignees());
}
- private static SearchWsRequest toSearchWsRequest(Request request) {
- return new SearchWsRequest()
+ private static SearchRequest toSearchWsRequest(Request request) {
+ return new SearchRequest()
.setAdditionalFields(request.paramAsStrings(PARAM_ADDITIONAL_FIELDS))
.setAsc(request.paramAsBoolean(PARAM_ASC))
.setAssigned(request.paramAsBoolean(PARAM_ASSIGNED))
import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
public enum SearchAdditionalField {
return possibles;
}
- public static EnumSet<SearchAdditionalField> getFromRequest(SearchWsRequest request) {
+ public static EnumSet<SearchAdditionalField> getFromRequest(SearchRequest request) {
List<String> labels = request.getAdditionalFields();
if (labels == null) {
return EnumSet.noneOf(SearchAdditionalField.class);
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Measures;
import org.sonarqube.ws.Measures.ComponentWsResponse;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
writeProtobuf(componentWsResponse, request, response);
}
- private ComponentWsResponse doHandle(ComponentWsRequest request) {
+ private ComponentWsResponse doHandle(ComponentRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
ComponentDto component = loadComponent(dbSession, request);
Long developerId = searchDeveloperId(dbSession, request);
}
}
- private ComponentDto loadComponent(DbSession dbSession, ComponentWsRequest request) {
+ private ComponentDto loadComponent(DbSession dbSession, ComponentRequest request) {
String componentKey = request.getComponent();
String componentId = request.getComponentId();
String branch = request.getBranch();
}
@CheckForNull
- private Long searchDeveloperId(DbSession dbSession, ComponentWsRequest request) {
+ private Long searchDeveloperId(DbSession dbSession, ComponentRequest request) {
if (request.getDeveloperId() == null && request.getDeveloperKey() == null) {
return null;
}
return dbClient.componentDao().selectByUuid(dbSession, component.getCopyResourceUuid());
}
- private static ComponentWsResponse buildResponse(ComponentWsRequest request, ComponentDto component, Optional<ComponentDto> refComponent, List<MeasureDto> measures,
- List<MetricDto> metrics, List<Measures.Period> periods) {
+ private static ComponentWsResponse buildResponse(ComponentRequest request, ComponentDto component, Optional<ComponentDto> refComponent, List<MeasureDto> measures,
+ List<MetricDto> metrics, List<Measures.Period> periods) {
ComponentWsResponse.Builder response = ComponentWsResponse.newBuilder();
Map<Integer, MetricDto> metricsById = Maps.uniqueIndex(metrics, MetricDto::getId);
Map<MetricDto, MeasureDto> measuresByMetric = new HashMap<>();
return response.build();
}
- private List<MetricDto> searchMetrics(DbSession dbSession, ComponentWsRequest request) {
+ private List<MetricDto> searchMetrics(DbSession dbSession, ComponentRequest request) {
List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, request.getMetricKeys());
if (metrics.size() < request.getMetricKeys().size()) {
List<String> foundMetricKeys = Lists.transform(metrics, MetricDto::getKey);
}
}
- private static ComponentWsRequest toComponentWsRequest(Request request) {
- ComponentWsRequest componentWsRequest = new ComponentWsRequest()
+ private static ComponentRequest toComponentWsRequest(Request request) {
+ ComponentRequest componentRequest = new ComponentRequest()
.setComponentId(request.param(DEPRECATED_PARAM_COMPONENT_ID))
.setComponent(request.param(PARAM_COMPONENT))
.setBranch(request.param(PARAM_BRANCH))
.setMetricKeys(request.mandatoryParamAsStrings(PARAM_METRIC_KEYS))
.setDeveloperId(request.param(PARAM_DEVELOPER_ID))
.setDeveloperKey(request.param(PARAM_DEVELOPER_KEY));
- checkRequest(!componentWsRequest.getMetricKeys().isEmpty(), "At least one metric key must be provided");
- return componentWsRequest;
+ checkRequest(!componentRequest.getMetricKeys().isEmpty(), "At least one metric key must be provided");
+ return componentRequest;
}
private void checkPermissions(ComponentDto baseComponent) {
import org.sonar.db.metric.MetricDto;
import org.sonarqube.ws.Measures;
import org.sonarqube.ws.Measures.ComponentTreeWsResponse;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
writeProtobuf(componentTreeWsResponse, request, response);
}
- private ComponentTreeWsResponse doHandle(ComponentTreeWsRequest request) {
+ private ComponentTreeWsResponse doHandle(ComponentTreeRequest request) {
ComponentTreeData data = dataLoader.load(request);
if (data.getComponents() == null) {
return emptyResponse(data.getBaseComponent(), request);
.andTotal(data.getComponentCount()));
}
- private static ComponentTreeWsResponse buildResponse(ComponentTreeWsRequest request, ComponentTreeData data, Paging paging) {
+ private static ComponentTreeWsResponse buildResponse(ComponentTreeRequest request, ComponentTreeData data, Paging paging) {
ComponentTreeWsResponse.Builder response = ComponentTreeWsResponse.newBuilder();
response.getPagingBuilder()
.setPageIndex(paging.pageIndex())
return response.build();
}
- private static boolean areMetricsInResponse(ComponentTreeWsRequest request) {
+ private static boolean areMetricsInResponse(ComponentTreeRequest request) {
List<String> additionalFields = request.getAdditionalFields();
return additionalFields != null && additionalFields.contains(ADDITIONAL_METRICS);
}
- private static boolean arePeriodsInResponse(ComponentTreeWsRequest request) {
+ private static boolean arePeriodsInResponse(ComponentTreeRequest request) {
List<String> additionalFields = request.getAdditionalFields();
return additionalFields != null && additionalFields.contains(ADDITIONAL_PERIODS);
}
- private static ComponentTreeWsResponse emptyResponse(ComponentDto baseComponent, ComponentTreeWsRequest request) {
+ private static ComponentTreeWsResponse emptyResponse(ComponentDto baseComponent, ComponentTreeRequest request) {
ComponentTreeWsResponse.Builder response = ComponentTreeWsResponse.newBuilder();
response.getPagingBuilder()
.setPageIndex(request.getPage())
return response.build();
}
- private static ComponentTreeWsRequest toComponentTreeWsRequest(Request request) {
+ private static ComponentTreeRequest toComponentTreeWsRequest(Request request) {
List<String> metricKeys = request.mandatoryParamAsStrings(PARAM_METRIC_KEYS);
checkArgument(metricKeys.size() <= MAX_METRIC_KEYS, "Number of metrics keys is limited to %s, got %s", MAX_METRIC_KEYS, metricKeys.size());
- ComponentTreeWsRequest componentTreeWsRequest = new ComponentTreeWsRequest()
+ ComponentTreeRequest componentTreeRequest = new ComponentTreeRequest()
.setBaseComponentId(request.param(DEPRECATED_PARAM_BASE_COMPONENT_ID))
.setComponent(request.param(PARAM_COMPONENT))
.setBranch(request.param(PARAM_BRANCH))
.setPage(request.mandatoryParamAsInt(Param.PAGE))
.setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE))
.setQuery(request.param(Param.TEXT_QUERY));
- String metricSortValue = componentTreeWsRequest.getMetricSort();
- checkRequest(!componentTreeWsRequest.getMetricKeys().isEmpty(), "The '%s' parameter must contain at least one metric key", PARAM_METRIC_KEYS);
- List<String> sorts = Optional.ofNullable(componentTreeWsRequest.getSort()).orElse(emptyList());
+ String metricSortValue = componentTreeRequest.getMetricSort();
+ checkRequest(!componentTreeRequest.getMetricKeys().isEmpty(), "The '%s' parameter must contain at least one metric key", PARAM_METRIC_KEYS);
+ List<String> sorts = Optional.ofNullable(componentTreeRequest.getSort()).orElse(emptyList());
checkRequest(metricSortValue == null ^ sorts.contains(METRIC_SORT) ^ sorts.contains(METRIC_PERIOD_SORT),
"To sort by a metric, the '%s' parameter must contain '%s' or '%s', and a metric key must be provided in the '%s' parameter",
Param.SORT, METRIC_SORT, METRIC_PERIOD_SORT, PARAM_METRIC_SORT);
- checkRequest(metricSortValue == null ^ componentTreeWsRequest.getMetricKeys().contains(metricSortValue),
+ checkRequest(metricSortValue == null ^ componentTreeRequest.getMetricKeys().contains(metricSortValue),
"To sort by the '%s' metric, it must be in the list of metric keys in the '%s' parameter", metricSortValue, PARAM_METRIC_KEYS);
- checkRequest(componentTreeWsRequest.getMetricPeriodSort() == null ^ sorts.contains(METRIC_PERIOD_SORT),
+ checkRequest(componentTreeRequest.getMetricPeriodSort() == null ^ sorts.contains(METRIC_PERIOD_SORT),
"To sort by a metric period, the '%s' parameter must contain '%s' and the '%s' must be provided.", Param.SORT, METRIC_PERIOD_SORT, PARAM_METRIC_PERIOD_SORT);
- checkRequest(ALL_METRIC_SORT_FILTER.equals(componentTreeWsRequest.getMetricSortFilter()) || metricSortValue != null,
+ checkRequest(ALL_METRIC_SORT_FILTER.equals(componentTreeRequest.getMetricSortFilter()) || metricSortValue != null,
"To filter components based on the sort metric, the '%s' parameter must contain '%s' or '%s' and the '%s' parameter must be provided",
Param.SORT, METRIC_SORT, METRIC_PERIOD_SORT, PARAM_METRIC_SORT);
- return componentTreeWsRequest;
+ return componentTreeRequest;
}
private static Measures.Component.Builder toWsComponent(ComponentDto component, Map<MetricDto, ComponentTreeData.Measure> measures,
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.measure.ws.ComponentTreeData.Measure;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
this.resourceTypes = resourceTypes;
}
- ComponentTreeData load(ComponentTreeWsRequest wsRequest) {
+ ComponentTreeData load(ComponentTreeRequest wsRequest) {
try (DbSession dbSession = dbClient.openSession(false)) {
ComponentDto baseComponent = loadComponent(dbSession, wsRequest);
checkPermissions(baseComponent);
}
}
- private ComponentDto loadComponent(DbSession dbSession, ComponentTreeWsRequest request) {
+ private ComponentDto loadComponent(DbSession dbSession, ComponentTreeRequest request) {
String componentKey = request.getComponent();
String componentId = request.getBaseComponentId();
String branch = request.getBranch();
}
@CheckForNull
- private Long searchDeveloperId(DbSession dbSession, ComponentTreeWsRequest wsRequest) {
+ private Long searchDeveloperId(DbSession dbSession, ComponentTreeRequest wsRequest) {
if (wsRequest.getDeveloperId() == null && wsRequest.getDeveloperKey() == null) {
return null;
}
return dbClient.componentDao().selectDescendants(dbSession, componentTreeQuery);
}
- private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) {
+ private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeRequest request) {
List<String> metricKeys = requireNonNull(request.getMetricKeys());
List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys);
if (metrics.size() < metricKeys.size()) {
}
private static List<ComponentDto> filterComponents(List<ComponentDto> components,
- Table<String, MetricDto, Measure> measuresByComponentUuidAndMetric, List<MetricDto> metrics, ComponentTreeWsRequest wsRequest) {
+ Table<String, MetricDto, Measure> measuresByComponentUuidAndMetric, List<MetricDto> metrics, ComponentTreeRequest wsRequest) {
if (!componentWithMeasuresOnly(wsRequest)) {
return components;
}
.collect(MoreCollectors.toList(components.size()));
}
- private static boolean componentWithMeasuresOnly(ComponentTreeWsRequest wsRequest) {
+ private static boolean componentWithMeasuresOnly(ComponentTreeRequest wsRequest) {
return WITH_MEASURES_ONLY_METRIC_SORT_FILTER.equals(wsRequest.getMetricSortFilter());
}
- private static List<ComponentDto> sortComponents(List<ComponentDto> components, ComponentTreeWsRequest wsRequest, List<MetricDto> metrics,
- Table<String, MetricDto, Measure> measuresByComponentUuidAndMetric) {
+ private static List<ComponentDto> sortComponents(List<ComponentDto> components, ComponentTreeRequest wsRequest, List<MetricDto> metrics,
+ Table<String, MetricDto, Measure> measuresByComponentUuidAndMetric) {
return ComponentTreeSort.sortComponents(components, wsRequest, metrics, measuresByComponentUuidAndMetric);
}
- private static List<ComponentDto> paginateComponents(List<ComponentDto> components, ComponentTreeWsRequest wsRequest) {
+ private static List<ComponentDto> paginateComponents(List<ComponentDto> components, ComponentTreeRequest wsRequest) {
return components.stream()
.skip(offset(wsRequest.getPage(), wsRequest.getPageSize()))
.limit(wsRequest.getPageSize())
}
@CheckForNull
- private List<String> childrenQualifiers(ComponentTreeWsRequest request, String baseQualifier) {
+ private List<String> childrenQualifiers(ComponentTreeRequest request, String baseQualifier) {
List<String> requestQualifiers = request.getQualifiers();
List<String> childrenQualifiers = null;
if (LEAVES_STRATEGY.equals(request.getStrategy())) {
return new ArrayList<>(qualifiersIntersection);
}
- private ComponentTreeQuery toComponentTreeQuery(ComponentTreeWsRequest wsRequest, ComponentDto baseComponent) {
+ private ComponentTreeQuery toComponentTreeQuery(ComponentTreeRequest wsRequest, ComponentDto baseComponent) {
List<String> childrenQualifiers = childrenQualifiers(wsRequest, baseComponent.qualifier());
ComponentTreeQuery.Builder componentTreeQueryBuilder = ComponentTreeQuery.builder()
import org.sonar.db.component.ComponentDto;
import org.sonar.db.metric.MetricDto;
import org.sonar.server.exceptions.BadRequestException;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
import static java.lang.String.CASE_INSENSITIVE_ORDER;
import static java.lang.String.format;
// static method only
}
- public static List<ComponentDto> sortComponents(List<ComponentDto> components, ComponentTreeWsRequest wsRequest, List<MetricDto> metrics,
- Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
+ public static List<ComponentDto> sortComponents(List<ComponentDto> components, ComponentTreeRequest wsRequest, List<MetricDto> metrics,
+ Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
List<String> sortParameters = wsRequest.getSort();
if (sortParameters == null || sortParameters.isEmpty()) {
return components;
return ordering.nullsLast().onResultOf(function);
}
- private static Ordering<ComponentDto> metricValueOrdering(ComponentTreeWsRequest wsRequest, List<MetricDto> metrics,
- Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
+ private static Ordering<ComponentDto> metricValueOrdering(ComponentTreeRequest wsRequest, List<MetricDto> metrics,
+ Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
if (wsRequest.getMetricSort() == null) {
return componentNameOrdering(wsRequest.getAsc());
}
throw new IllegalStateException("Unrecognized metric value type: " + metric.getValueType());
}
- private static Ordering<ComponentDto> metricPeriodOrdering(ComponentTreeWsRequest wsRequest, List<MetricDto> metrics,
- Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
+ private static Ordering<ComponentDto> metricPeriodOrdering(ComponentTreeRequest wsRequest, List<MetricDto> metrics,
+ Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
if (wsRequest.getMetricSort() == null || wsRequest.getMetricPeriodSort() == null) {
return componentNameOrdering(wsRequest.getAsc());
}
return ordering.nullsLast().onResultOf(new ComponentDtoToNumericalMeasureValue(metric, measuresByComponentUuidAndMetric));
}
- private static Ordering<ComponentDto> numericalMetricPeriodOrdering(ComponentTreeWsRequest request, @Nullable MetricDto metric,
- Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
+ private static Ordering<ComponentDto> numericalMetricPeriodOrdering(ComponentTreeRequest request, @Nullable MetricDto metric,
+ Table<String, MetricDto, ComponentTreeData.Measure> measuresByComponentUuidAndMetric) {
Ordering<Double> ordering = Ordering.natural();
if (!request.getAsc()) {
import javax.annotation.Nonnull;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.metric.MetricDto;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
import static org.sonar.server.measure.ws.ComponentTreeData.Measure;
class HasMeasure implements Predicate<ComponentDto> {
private final Predicate<ComponentDto> predicate;
- HasMeasure(Table<String, MetricDto, ComponentTreeData.Measure> table, MetricDto metric, ComponentTreeWsRequest request) {
+ HasMeasure(Table<String, MetricDto, ComponentTreeData.Measure> table, MetricDto metric, ComponentTreeRequest request) {
Integer periodIndex = request.getMetricPeriodSort();
this.predicate = periodIndex == null
? new HasAbsoluteValue(table, metric)
import org.sonarqube.ws.Permissions.Permission;
import org.sonarqube.ws.Permissions.SearchProjectPermissionsWsResponse;
import org.sonarqube.ws.Permissions.SearchProjectPermissionsWsResponse.Project;
-import org.sonarqube.ws.client.permission.SearchProjectPermissionsWsRequest;
+import org.sonarqube.ws.client.permission.SearchProjectPermissionsRequest;
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateQualifier;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
writeProtobuf(searchProjectPermissionsWsResponse, wsRequest, wsResponse);
}
- private SearchProjectPermissionsWsResponse doHandle(SearchProjectPermissionsWsRequest request) {
+ private SearchProjectPermissionsWsResponse doHandle(SearchProjectPermissionsRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
checkAuthorized(dbSession, request);
validateQualifier(request.getQualifier(), resourceTypes);
}
}
- private static SearchProjectPermissionsWsRequest toSearchProjectPermissionsWsRequest(Request request) {
- return new SearchProjectPermissionsWsRequest()
+ private static SearchProjectPermissionsRequest toSearchProjectPermissionsWsRequest(Request request) {
+ return new SearchProjectPermissionsRequest()
.setProjectId(request.param(PARAM_PROJECT_ID))
.setProjectKey(request.param(PARAM_PROJECT_KEY))
.setQualifier(request.param(PARAM_QUALIFIER))
.setQuery(request.param(Param.TEXT_QUERY));
}
- private void checkAuthorized(DbSession dbSession, SearchProjectPermissionsWsRequest request) {
+ private void checkAuthorized(DbSession dbSession, SearchProjectPermissionsRequest request) {
com.google.common.base.Optional<ProjectWsRef> projectRef = newOptionalWsProjectRef(request.getProjectId(), request.getProjectKey());
if (projectRef.isPresent()) {
ComponentDto project = wsSupport.getRootComponentOrModule(dbSession, projectRef.get());
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.ComponentQuery;
import org.sonar.db.permission.CountPerProjectPermission;
-import org.sonarqube.ws.client.permission.SearchProjectPermissionsWsRequest;
+import org.sonarqube.ws.client.permission.SearchProjectPermissionsRequest;
import static java.util.Collections.singletonList;
import static org.sonar.api.utils.Paging.forPageIndex;
this.rootQualifiers = Collections2.transform(resourceTypes.getRoots(), ResourceType::getQualifier).toArray(new String[resourceTypes.getRoots().size()]);
}
- SearchProjectPermissionsData load(DbSession dbSession, SearchProjectPermissionsWsRequest request) {
+ SearchProjectPermissionsData load(DbSession dbSession, SearchProjectPermissionsRequest request) {
SearchProjectPermissionsData.Builder data = newBuilder();
int countRootComponents = countRootComponents(dbSession, request);
List<ComponentDto> rootComponents = searchRootComponents(dbSession, request, paging(request, countRootComponents));
return data.build();
}
- private static Paging paging(SearchProjectPermissionsWsRequest request, int total) {
+ private static Paging paging(SearchProjectPermissionsRequest request, int total) {
return forPageIndex(request.getPage())
.withPageSize(request.getPageSize())
.andTotal(total);
}
- private int countRootComponents(DbSession dbSession, SearchProjectPermissionsWsRequest request) {
+ private int countRootComponents(DbSession dbSession, SearchProjectPermissionsRequest request) {
return dbClient.componentDao().countByQuery(dbSession, toDbQuery(request));
}
- private List<ComponentDto> searchRootComponents(DbSession dbSession, SearchProjectPermissionsWsRequest request, Paging paging) {
+ private List<ComponentDto> searchRootComponents(DbSession dbSession, SearchProjectPermissionsRequest request, Paging paging) {
Optional<ProjectWsRef> project = newOptionalWsProjectRef(request.getProjectId(), request.getProjectKey());
if (project.isPresent()) {
return dbClient.componentDao().selectByQuery(dbSession, toDbQuery(request), paging.offset(), paging.pageSize());
}
- private ComponentQuery toDbQuery(SearchProjectPermissionsWsRequest wsRequest) {
+ private ComponentQuery toDbQuery(SearchProjectPermissionsRequest wsRequest) {
return ComponentQuery.builder()
.setQualifiers(qualifiers(wsRequest.getQualifier()))
.setNameOrKeyQuery(wsRequest.getQuery())
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest;
+import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
this.system = system;
}
- private static AddProjectCreatorToTemplateWsRequest toWsRequest(Request request) {
- AddProjectCreatorToTemplateWsRequest wsRequest = AddProjectCreatorToTemplateWsRequest.builder()
+ private static AddProjectCreatorToTemplateRequest toWsRequest(Request request) {
+ AddProjectCreatorToTemplateRequest wsRequest = AddProjectCreatorToTemplateRequest.builder()
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
.setOrganization(request.param(PARAM_ORGANIZATION))
response.noContent();
}
- private void doHandle(AddProjectCreatorToTemplateWsRequest request) {
+ private void doHandle(AddProjectCreatorToTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
PermissionTemplateDto template = wsSupport.findTemplate(dbSession, WsTemplateRef.newTemplateRef(
request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
}
}
- private void addTemplatePermission(DbSession dbSession, AddProjectCreatorToTemplateWsRequest request, PermissionTemplateDto template) {
+ private void addTemplatePermission(DbSession dbSession, AddProjectCreatorToTemplateRequest request, PermissionTemplateDto template) {
long now = system.now();
dbClient.permissionTemplateCharacteristicDao().insert(dbSession, new PermissionTemplateCharacteristicDto()
.setPermission(request.getPermission())
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest;
+import org.sonarqube.ws.client.permission.AddUserToTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
this.userSession = userSession;
}
- private static AddUserToTemplateWsRequest toAddUserToTemplateWsRequest(Request request) {
- return new AddUserToTemplateWsRequest()
+ private static AddUserToTemplateRequest toAddUserToTemplateWsRequest(Request request) {
+ return new AddUserToTemplateRequest()
.setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
response.noContent();
}
- private void doHandle(AddUserToTemplateWsRequest request) {
+ private void doHandle(AddUserToTemplateRequest request) {
String permission = request.getPermission();
String userLogin = request.getLogin();
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.ApplyTemplateWsRequest;
+import org.sonarqube.ws.client.permission.ApplyTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
this.wsSupport = wsSupport;
}
- private static ApplyTemplateWsRequest toApplyTemplateWsRequest(Request request) {
- return new ApplyTemplateWsRequest()
+ private static ApplyTemplateRequest toApplyTemplateWsRequest(Request request) {
+ return new ApplyTemplateRequest()
.setProjectId(request.param(PARAM_PROJECT_ID))
.setProjectKey(request.param(PARAM_PROJECT_KEY))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
response.noContent();
}
- private void doHandle(ApplyTemplateWsRequest request) {
+ private void doHandle(ApplyTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
PermissionTemplateDto template = wsSupport.findTemplate(dbSession, newTemplateRef(
request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.project.Visibility;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.BulkApplyTemplateWsRequest;
+import org.sonarqube.ws.client.permission.BulkApplyTemplateRequest;
import static org.sonar.api.utils.DateUtils.parseDateOrDateTime;
import static org.sonar.core.util.Protobuf.setNullable;
response.noContent();
}
- private void doHandle(BulkApplyTemplateWsRequest request) {
+ private void doHandle(BulkApplyTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
PermissionTemplateDto template = wsSupport.findTemplate(dbSession, newTemplateRef(
request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
}
}
- private static BulkApplyTemplateWsRequest toBulkApplyTemplateWsRequest(Request request) {
- return new BulkApplyTemplateWsRequest()
+ private static BulkApplyTemplateRequest toBulkApplyTemplateWsRequest(Request request) {
+ return new BulkApplyTemplateRequest()
.setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME))
.setProjects(request.paramAsStrings(PARAM_PROJECTS));
}
- private static ComponentQuery buildDbQuery(BulkApplyTemplateWsRequest request) {
+ private static ComponentQuery buildDbQuery(BulkApplyTemplateRequest request) {
Collection<String> qualifiers = request.getQualifiers();
ComponentQuery.Builder query = ComponentQuery.builder()
.setQualifiers(qualifiers.toArray(new String[qualifiers.size()]));
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Permissions.CreateTemplateWsResponse;
import org.sonarqube.ws.Permissions.PermissionTemplate;
-import org.sonarqube.ws.client.permission.CreateTemplateWsRequest;
+import org.sonarqube.ws.client.permission.CreateTemplateRequest;
import static java.lang.String.format;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
this.wsSupport = wsSupport;
}
- private static CreateTemplateWsRequest toCreateTemplateWsRequest(Request request) {
- return new CreateTemplateWsRequest()
+ private static CreateTemplateRequest toCreateTemplateWsRequest(Request request) {
+ return new CreateTemplateRequest()
.setName(request.mandatoryParam(PARAM_NAME))
.setDescription(request.param(PARAM_DESCRIPTION))
.setProjectKeyPattern(request.param(PARAM_PROJECT_KEY_PATTERN))
writeProtobuf(createTemplateWsResponse, request, response);
}
- private CreateTemplateWsResponse doHandle(CreateTemplateWsRequest request) {
+ private CreateTemplateWsResponse doHandle(CreateTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto org = wsSupport.findOrganization(dbSession, request.getOrganization());
checkGlobalAdmin(userSession, org.getUuid());
checkRequest(permissionTemplateWithSameName == null, format(MSG_TEMPLATE_WITH_SAME_NAME, name));
}
- private PermissionTemplateDto insertTemplate(DbSession dbSession, OrganizationDto org, CreateTemplateWsRequest request) {
+ private PermissionTemplateDto insertTemplate(DbSession dbSession, OrganizationDto org, CreateTemplateRequest request) {
Date now = new Date(system.now());
PermissionTemplateDto template = dbClient.permissionTemplateDao().insert(dbSession, new PermissionTemplateDto()
.setUuid(Uuids.create())
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.DeleteTemplateWsRequest;
+import org.sonarqube.ws.client.permission.DeleteTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
this.defaultTemplatesResolver = defaultTemplatesResolver;
}
- private static DeleteTemplateWsRequest toDeleteTemplateWsRequest(Request request) {
- return new DeleteTemplateWsRequest()
+ private static DeleteTemplateRequest toDeleteTemplateWsRequest(Request request) {
+ return new DeleteTemplateRequest()
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
.setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME));
response.noContent();
}
- private void doHandle(DeleteTemplateWsRequest request) {
+ private void doHandle(DeleteTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
PermissionTemplateDto template = finder.findTemplate(dbSession, newTemplateRef(
request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequest;
+import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
this.system = system;
}
- private static RemoveProjectCreatorFromTemplateWsRequest toWsRequest(Request request) {
- RemoveProjectCreatorFromTemplateWsRequest wsRequest = RemoveProjectCreatorFromTemplateWsRequest.builder()
+ private static RemoveProjectCreatorFromTemplateRequest toWsRequest(Request request) {
+ RemoveProjectCreatorFromTemplateRequest wsRequest = RemoveProjectCreatorFromTemplateRequest.builder()
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
.setOrganization(request.param(PARAM_ORGANIZATION))
response.noContent();
}
- private void doHandle(RemoveProjectCreatorFromTemplateWsRequest request) {
+ private void doHandle(RemoveProjectCreatorFromTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
PermissionTemplateDto template = wsSupport.findTemplate(dbSession, WsTemplateRef.newTemplateRef(
request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.RemoveUserFromTemplateWsRequest;
+import org.sonarqube.ws.client.permission.RemoveUserFromTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
this.userSession = userSession;
}
- private static RemoveUserFromTemplateWsRequest toRemoveUserFromTemplateWsRequest(Request request) {
- return new RemoveUserFromTemplateWsRequest()
+ private static RemoveUserFromTemplateRequest toRemoveUserFromTemplateWsRequest(Request request) {
+ return new RemoveUserFromTemplateRequest()
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
response.noContent();
}
- private void doHandle(RemoveUserFromTemplateWsRequest request) {
+ private void doHandle(RemoveUserFromTemplateRequest request) {
String permission = request.getPermission();
String userLogin = request.getLogin();
import org.sonarqube.ws.Permissions.PermissionTemplate;
import org.sonarqube.ws.Permissions.SearchTemplatesWsResponse;
import org.sonarqube.ws.Permissions.SearchTemplatesWsResponse.TemplateIdQualifier;
-import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest;
+import org.sonarqube.ws.client.permission.SearchTemplatesRequest;
import static org.sonar.api.utils.DateUtils.formatDateTime;
import static org.sonar.core.util.Protobuf.setNullable;
public void handle(Request wsRequest, Response wsResponse) throws Exception {
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION));
- SearchTemplatesWsRequest request = new SearchTemplatesWsRequest()
+ SearchTemplatesRequest request = new SearchTemplatesRequest()
.setOrganizationUuid(org.getUuid())
.setQuery(wsRequest.param(Param.TEXT_QUERY));
checkGlobalAdmin(userSession, request.getOrganizationUuid());
import org.sonar.db.permission.template.PermissionTemplateCharacteristicDto;
import org.sonar.db.permission.template.PermissionTemplateDto;
import org.sonar.server.permission.ws.template.DefaultTemplatesResolver.ResolvedDefaultTemplates;
-import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest;
+import org.sonarqube.ws.client.permission.SearchTemplatesRequest;
import static org.sonar.server.permission.ws.template.SearchTemplatesData.builder;
import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
this.defaultTemplatesResolver = defaultTemplatesResolver;
}
- public SearchTemplatesData load(DbSession dbSession, SearchTemplatesWsRequest request) {
+ public SearchTemplatesData load(DbSession dbSession, SearchTemplatesRequest request) {
SearchTemplatesData.Builder data = builder();
List<PermissionTemplateDto> templates = searchTemplates(dbSession, request);
List<Long> templateIds = Lists.transform(templates, PermissionTemplateDto::getId);
return data.build();
}
- private List<PermissionTemplateDto> searchTemplates(DbSession dbSession, SearchTemplatesWsRequest request) {
+ private List<PermissionTemplateDto> searchTemplates(DbSession dbSession, SearchTemplatesRequest request) {
return dbClient.permissionTemplateDao().selectAll(dbSession, request.getOrganizationUuid(), request.getQuery());
}
import org.sonar.server.permission.ws.PermissionWsSupport;
import org.sonar.server.permission.ws.PermissionsWsAction;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.permission.SetDefaultTemplateWsRequest;
+import org.sonarqube.ws.client.permission.SetDefaultTemplateRequest;
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateQualifier;
this.i18n = i18n;
}
- private static SetDefaultTemplateWsRequest toSetDefaultTemplateWsRequest(Request request) {
- return new SetDefaultTemplateWsRequest()
+ private static SetDefaultTemplateRequest toSetDefaultTemplateWsRequest(Request request) {
+ return new SetDefaultTemplateRequest()
.setQualifier(request.param(PARAM_QUALIFIER))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
.setOrganization(request.param(PARAM_ORGANIZATION))
response.noContent();
}
- private void doHandle(SetDefaultTemplateWsRequest request) {
+ private void doHandle(SetDefaultTemplateRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
String qualifier = request.getQualifier();
PermissionTemplateDto template = findTemplate(dbSession, request);
}
}
- private PermissionTemplateDto findTemplate(DbSession dbSession, SetDefaultTemplateWsRequest request) {
+ private PermissionTemplateDto findTemplate(DbSession dbSession, SetDefaultTemplateRequest request) {
return wsSupport.findTemplate(dbSession, newTemplateRef(request.getTemplateId(),
request.getOrganization(), request.getTemplateName()));
}
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Permissions.PermissionTemplate;
import org.sonarqube.ws.Permissions.UpdateTemplateWsResponse;
-import org.sonarqube.ws.client.permission.UpdateTemplateWsRequest;
+import org.sonarqube.ws.client.permission.UpdateTemplateRequest;
import static com.google.common.base.MoreObjects.firstNonNull;
import static java.lang.String.format;
this.wsSupport = wsSupport;
}
- private static UpdateTemplateWsRequest toUpdateTemplateWsRequest(Request request) {
- return new UpdateTemplateWsRequest()
+ private static UpdateTemplateRequest toUpdateTemplateWsRequest(Request request) {
+ return new UpdateTemplateRequest()
.setId(request.mandatoryParam(PARAM_ID))
.setName(request.param(PARAM_NAME))
.setDescription(request.param(PARAM_DESCRIPTION))
writeProtobuf(updateTemplateWsResponse, request, response);
}
- private UpdateTemplateWsResponse doHandle(UpdateTemplateWsRequest request) {
+ private UpdateTemplateWsResponse doHandle(UpdateTemplateRequest request) {
String uuid = request.getId();
String nameParam = request.getName();
String descriptionParam = request.getDescription();
import org.sonar.server.component.ComponentCleanerService;
import org.sonar.server.project.Visibility;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static org.sonar.api.resources.Qualifiers.APP;
import static org.sonar.api.resources.Qualifiers.PROJECT;
@Override
public void handle(Request request, Response response) throws Exception {
- SearchWsRequest searchRequest = toSearchWsRequest(request);
+ SearchRequest searchRequest = toSearchWsRequest(request);
userSession.checkLoggedIn();
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto organization = support.getOrganization(dbSession, searchRequest.getOrganization());
response.noContent();
}
- private static SearchWsRequest toSearchWsRequest(Request request) {
- return SearchWsRequest.builder()
+ private static SearchRequest toSearchWsRequest(Request request) {
+ return SearchRequest.builder()
.setOrganization(request.param(PARAM_ORGANIZATION))
.setQualifiers(request.mandatoryParamAsStrings(PARAM_QUALIFIERS))
.setQuery(request.param(Param.TEXT_QUERY))
import org.sonar.server.component.ComponentService;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Projects.BulkUpdateKeyWsResponse;
-import org.sonarqube.ws.client.project.BulkUpdateKeyWsRequest;
+import org.sonarqube.ws.client.project.BulkUpdateKeyRequest;
import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
import static org.sonar.db.component.ComponentKeyUpdaterDao.checkIsProjectOrModule;
writeProtobuf(doHandle(toWsRequest(request)), request, response);
}
- private BulkUpdateKeyWsResponse doHandle(BulkUpdateKeyWsRequest request) {
+ private BulkUpdateKeyWsResponse doHandle(BulkUpdateKeyRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
ComponentDto projectOrModule = componentFinder.getByUuidOrKey(dbSession, request.getId(), request.getKey(), ParamNames.ID_AND_KEY);
checkIsProjectOrModule(projectOrModule);
newKeysWithDuplicateMap.entrySet().forEach(entry -> checkRequest(!entry.getValue(), "Impossible to update key: a component with key \"%s\" already exists.", entry.getKey()));
}
- private void bulkUpdateKey(DbSession dbSession, BulkUpdateKeyWsRequest request, ComponentDto projectOrModule) {
+ private void bulkUpdateKey(DbSession dbSession, BulkUpdateKeyRequest request, ComponentDto projectOrModule) {
componentService.bulkUpdateKey(dbSession, projectOrModule, request.getFrom(), request.getTo());
}
return response.build();
}
- private static BulkUpdateKeyWsRequest toWsRequest(Request request) {
- return BulkUpdateKeyWsRequest.builder()
+ private static BulkUpdateKeyRequest toWsRequest(Request request) {
+ return BulkUpdateKeyRequest.builder()
.setId(request.param(PARAM_PROJECT_ID))
.setKey(request.param(PARAM_PROJECT))
.setFrom(request.mandatoryParam(PARAM_FROM))
import org.sonar.server.project.Visibility;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Projects.SearchWsResponse;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static com.google.common.base.Preconditions.checkArgument;
import static org.sonar.api.resources.Qualifiers.APP;
writeProtobuf(searchWsResponse, wsRequest, wsResponse);
}
- private static SearchWsRequest toSearchWsRequest(Request request) {
- return SearchWsRequest.builder()
+ private static SearchRequest toSearchWsRequest(Request request) {
+ return SearchRequest.builder()
.setOrganization(request.param(PARAM_ORGANIZATION))
.setQualifiers(request.mandatoryParamAsStrings(PARAM_QUALIFIERS))
.setQuery(request.param(Param.TEXT_QUERY))
.build();
}
- private SearchWsResponse doHandle(SearchWsRequest request) {
+ private SearchWsResponse doHandle(SearchRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto organization = support.getOrganization(dbSession, request.getOrganization());
userSession.checkPermission(OrganizationPermission.ADMINISTER, organization);
}
}
- static ComponentQuery buildDbQuery(SearchWsRequest request) {
+ static ComponentQuery buildDbQuery(SearchRequest request) {
List<String> qualifiers = request.getQualifiers();
ComponentQuery.Builder query = ComponentQuery.builder()
.setQualifiers(qualifiers.toArray(new String[qualifiers.size()]));
return query.build();
}
- private Paging buildPaging(DbSession dbSession, SearchWsRequest request, OrganizationDto organization, ComponentQuery query) {
+ private Paging buildPaging(DbSession dbSession, SearchRequest request, OrganizationDto organization, ComponentQuery query) {
int total = dbClient.componentDao().countByQuery(dbSession, organization.getUuid(), query);
return Paging.forPageIndex(request.getPage())
.withPageSize(request.getPageSize())
import org.sonar.server.component.ComponentFinder;
import org.sonar.server.component.ComponentFinder.ParamNames;
import org.sonar.server.component.ComponentService;
-import org.sonarqube.ws.client.project.UpdateKeyWsRequest;
+import org.sonarqube.ws.client.project.UpdateKeyRequest;
import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
import static org.sonarqube.ws.client.project.ProjectsWsParameters.ACTION_UPDATE_KEY;
response.noContent();
}
- private void doHandle(UpdateKeyWsRequest request) {
+ private void doHandle(UpdateKeyRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
ComponentDto projectOrModule = componentFinder.getByUuidOrKey(dbSession, request.getId(), request.getKey(), ParamNames.PROJECT_ID_AND_FROM);
componentService.updateKey(dbSession, projectOrModule, request.getNewKey());
}
}
- private static UpdateKeyWsRequest toWsRequest(Request request) {
- return UpdateKeyWsRequest.builder()
+ private static UpdateKeyRequest toWsRequest(Request request) {
+ return UpdateKeyRequest.builder()
.setId(request.param(PARAM_PROJECT_ID))
.setKey(request.param(PARAM_FROM))
.setNewKey(request.mandatoryParam(PARAM_TO))
import org.sonar.server.util.LanguageParamUtils;
import org.sonarqube.ws.Qualityprofiles.SearchWsResponse;
import org.sonarqube.ws.Qualityprofiles.SearchWsResponse.QualityProfile;
-import org.sonarqube.ws.client.qualityprofile.SearchWsRequest;
+import org.sonarqube.ws.client.qualityprofile.SearchRequest;
import static com.google.common.base.Preconditions.checkState;
import static java.lang.String.format;
writeProtobuf(searchWsResponse, request, response);
}
- private static SearchWsRequest toSearchWsRequest(Request request) {
- return new SearchWsRequest()
+ private static SearchRequest toSearchWsRequest(Request request) {
+ return new SearchRequest()
.setOrganizationKey(request.param(PARAM_ORGANIZATION))
.setProjectKey(request.param(PARAM_PROJECT))
.setQualityProfile(request.param(PARAM_QUALITY_PROFILE))
.setLanguage(request.param(PARAM_LANGUAGE));
}
- private SearchWsResponse doHandle(SearchWsRequest request) {
+ private SearchWsResponse doHandle(SearchRequest request) {
SearchData data = load(request);
return buildResponse(data);
}
- private SearchData load(SearchWsRequest request) {
+ private SearchData load(SearchRequest request) {
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationDto organization = wsSupport.getOrganizationByKey(dbSession, request.getOrganizationKey());
}
@CheckForNull
- private ComponentDto findProject(DbSession dbSession, OrganizationDto organization, SearchWsRequest request) {
+ private ComponentDto findProject(DbSession dbSession, OrganizationDto organization, SearchRequest request) {
if (request.getProjectKey() == null) {
return null;
}
.collect(toList());
}
- private List<QProfileDto> searchProfiles(DbSession dbSession, SearchWsRequest request, OrganizationDto organization, List<QProfileDto> defaultProfiles,
+ private List<QProfileDto> searchProfiles(DbSession dbSession, SearchRequest request, OrganizationDto organization, List<QProfileDto> defaultProfiles,
@Nullable ComponentDto project) {
Collection<QProfileDto> profiles = selectAllProfiles(dbSession, organization);
return p -> languages.get(p.getLanguage()) != null;
}
- private static Predicate<QProfileDto> byName(SearchWsRequest request) {
+ private static Predicate<QProfileDto> byName(SearchRequest request) {
return p -> request.getQualityProfile() == null || Objects.equals(p.getName(), request.getQualityProfile());
}
- private static Predicate<QProfileDto> byLanguage(SearchWsRequest request) {
+ private static Predicate<QProfileDto> byLanguage(SearchRequest request) {
return p -> request.getLanguage() == null || Objects.equals(p.getLanguage(), request.getLanguage());
}
- private static Predicate<QProfileDto> byDefault(SearchWsRequest request, List<QProfileDto> defaultProfiles) {
+ private static Predicate<QProfileDto> byDefault(SearchRequest request, List<QProfileDto> defaultProfiles) {
Set<String> defaultProfileUuids = defaultProfiles.stream().map(QProfileDto::getKee).collect(Collectors.toSet());
return p -> !request.getDefaults() || defaultProfileUuids.contains(p.getKee());
}
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.Components.Component;
import org.sonarqube.ws.Components.SearchWsResponse;
-import org.sonarqube.ws.client.component.SearchWsRequest;
+import org.sonarqube.ws.client.component.SearchRequest;
import static java.util.Arrays.asList;
import static java.util.Collections.emptySet;
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("project-_%-key"),
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("project-key-without-escaped-characters"));
- SearchWsResponse response = call(new SearchWsRequest().setQuery("project-_%-key").setQualifiers(singletonList(PROJECT)));
+ SearchWsResponse response = call(new SearchRequest().setQuery("project-_%-key").setQualifiers(singletonList(PROJECT)));
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("project-_%-key");
}
db.components().insertComponents(project, file1, file2);
setBrowsePermissionOnUserAndIndex(project);
- SearchWsResponse response = call(new SearchWsRequest().setQuery(file1.getDbKey()).setQualifiers(singletonList(FILE)));
+ SearchWsResponse response = call(new SearchRequest().setQuery(file1.getDbKey()).setQualifiers(singletonList(FILE)));
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(file1.getDbKey());
}
}
insertProjectsAuthorizedForUser(componentDtoList.toArray(new ComponentDto[] {}));
- SearchWsResponse response = call(new SearchWsRequest().setOrganization(organizationDto.getKey()).setPage(2).setPageSize(3).setQualifiers(singletonList(PROJECT)));
+ SearchWsResponse response = call(new SearchRequest().setOrganization(organizationDto.getKey()).setPage(2).setPageSize(3).setQualifiers(singletonList(PROJECT)));
assertThat(response.getComponentsList()).extracting(Component::getKey).containsExactly("project-key-4", "project-key-5", "project-key-6");
}
ComponentTesting.newPrivateProjectDto(organizationDto).setDbKey("java-project").setLanguage("java"),
ComponentTesting.newPrivateProjectDto(organizationDto).setDbKey("cpp-project").setLanguage("cpp"));
- SearchWsResponse response = call(new SearchWsRequest().setOrganization(organizationDto.getKey()).setLanguage("java").setQualifiers(singletonList(PROJECT)));
+ SearchWsResponse response = call(new SearchRequest().setOrganization(organizationDto.getKey()).setLanguage("java").setQualifiers(singletonList(PROJECT)));
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("java-project");
}
db.components().insertComponents(project1, file1, file2, project2, file3);
setBrowsePermissionOnUserAndIndex(project1);
- SearchWsResponse response = call(new SearchWsRequest().setQualifiers(singletonList(FILE)));
+ SearchWsResponse response = call(new SearchRequest().setQualifiers(singletonList(FILE)));
assertThat(response.getComponentsList()).extracting(Component::getKey)
.containsExactlyInAnyOrder(file1.getDbKey(), file2.getDbKey());
db.components().insertComponents(project, module, file1, file2, file3);
setBrowsePermissionOnUserAndIndex(project);
- SearchWsResponse response = call(new SearchWsRequest().setQualifiers(asList(PROJECT, MODULE, FILE)));
+ SearchWsResponse response = call(new SearchRequest().setQualifiers(asList(PROJECT, MODULE, FILE)));
assertThat(response.getComponentsList()).extracting(Component::getKey, Component::getProject)
.containsOnly(tuple(project.getDbKey(), project.getDbKey()),
ComponentDto branch = db.components().insertProjectBranch(project);
setBrowsePermissionOnUserAndIndex(project, branch);
- SearchWsResponse response = call(new SearchWsRequest().setQualifiers(asList(PROJECT, MODULE, FILE)));
+ SearchWsResponse response = call(new SearchRequest().setQualifiers(asList(PROJECT, MODULE, FILE)));
assertThat(response.getComponentsList()).extracting(Component::getKey)
.containsOnly(project.getDbKey());
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Value of parameter 'qualifiers' (Unknown-Qualifier) must be one of: [BRC, DIR, FIL, TRK]");
- call(new SearchWsRequest().setQualifiers(singletonList("Unknown-Qualifier")));
+ call(new SearchRequest().setQualifiers(singletonList("Unknown-Qualifier")));
}
@Test
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("The 'qualifiers' parameter is missing");
- call(new SearchWsRequest());
+ call(new SearchRequest());
}
@Test
Arrays.stream(projects).forEach(project -> authorizationIndexerTester.allowOnlyUser(project, user));
}
- private SearchWsResponse call(SearchWsRequest wsRequest) {
+ private SearchWsResponse call(SearchRequest wsRequest) {
TestRequest request = ws.newRequest();
setNullable(wsRequest.getOrganization(), p -> request.setParam(PARAM_ORGANIZATION, p));
setNullable(wsRequest.getLanguage(), p -> request.setParam(PARAM_LANGUAGE, p));
import org.sonar.db.organization.OrganizationDto;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.tester.UserSessionRule;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
ComponentDto module = db.components().insertComponent(newModuleDto(project));
ComponentDto file = db.components().insertComponent(newFileDto(project));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setIssues(asList("anIssueKey"))
.setSeverities(asList("MAJOR", "MINOR"))
.setStatuses(asList("CLOSED"))
@Test
public void dates_are_inclusive() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setCreatedAfter("2013-04-16")
.setCreatedBefore("2013-04-17");
@Test
public void creation_date_support_localdate() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setCreatedAt("2013-04-16");
IssueQuery query = underTest.create(request);
@Test
public void creation_date_support_zoneddatetime() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setCreatedAt("2013-04-16T09:08:24+0200");
IssueQuery query = underTest.create(request);
@Test
public void add_unknown_when_no_component_found() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentKeys(asList("does_not_exist"));
IssueQuery query = underTest.create(request);
@Test
public void query_without_any_parameter() {
- SearchWsRequest request = new SearchWsRequest();
+ SearchRequest request = new SearchRequest();
IssueQuery query = underTest.create(request);
@Test
public void fail_if_components_and_components_uuid_params_are_set_at_the_same_time() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentKeys(asList("foo"))
.setComponentUuids(asList("bar"));
@Test
public void fail_if_both_projects_and_projectUuids_params_are_set() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setProjectKeys(asList("foo"))
.setProjectUuids(asList("bar"));
@Test
public void fail_if_both_componentRoots_and_componentRootUuids_params_are_set() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentRoots(asList("foo"))
.setComponentRootUuids(asList("bar"));
public void fail_if_componentRoots_references_components_with_different_qualifier() {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto file = db.components().insertComponent(newFileDto(project));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentRoots(asList(project.getDbKey(), file.getDbKey()));
expectedException.expect(IllegalArgumentException.class);
@Test
public void param_componentRootUuids_enables_search_in_view_tree_if_user_has_permission_on_view() {
ComponentDto view = db.components().insertView();
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentRootUuids(asList(view.uuid()));
userSession.registerComponents(view);
db.components().insertComponents(newProjectCopy("PC2", project2, application));
userSession.registerComponents(application, project1, project2);
- IssueQuery result = underTest.create(new SearchWsRequest().setComponentUuids(singletonList(application.uuid())));
+ IssueQuery result = underTest.create(new SearchRequest().setComponentUuids(singletonList(application.uuid())));
assertThat(result.viewUuids()).containsExactlyInAnyOrder(application.uuid());
}
db.components().insertComponents(newProjectCopy("PC3", project3, application));
userSession.registerComponents(application, project1, project2, project3);
- IssueQuery result = underTest.create(new SearchWsRequest()
+ IssueQuery result = underTest.create(new SearchRequest()
.setComponentUuids(singletonList(application.uuid()))
.setSinceLeakPeriod(true));
public void return_empty_results_if_not_allowed_to_search_for_subview() {
ComponentDto view = db.components().insertView();
ComponentDto subView = db.components().insertComponent(newSubView(view));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentRootUuids(asList(subView.uuid()));
IssueQuery query = underTest.create(request);
@Test
public void param_componentUuids_enables_search_on_project_tree_by_default() {
ComponentDto project = db.components().insertPrivateProject();
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentUuids(asList(project.uuid()));
IssueQuery query = underTest.create(request);
@Test
public void onComponentOnly_restricts_search_to_specified_componentKeys() {
ComponentDto project = db.components().insertPrivateProject();
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentKeys(asList(project.getDbKey()))
.setOnComponentOnly(true);
public void should_search_in_tree_with_module_uuid() {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto module = db.components().insertComponent(newModuleDto(project));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentUuids(asList(module.uuid()));
IssueQuery query = underTest.create(request);
public void param_componentUuids_enables_search_in_directory_tree() {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto dir = db.components().insertComponent(newDirectory(project, "src/main/java/foo"));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentUuids(asList(dir.uuid()));
IssueQuery query = underTest.create(request);
public void param_componentUuids_enables_search_by_file() {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto file = db.components().insertComponent(newFileDto(project));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentUuids(asList(file.uuid()));
IssueQuery query = underTest.create(request);
public void param_componentUuids_enables_search_by_test_file() {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto file = db.components().insertComponent(newFileDto(project).setQualifier(Qualifiers.UNIT_TEST_FILE));
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setComponentUuids(asList(file.uuid()));
IssueQuery query = underTest.create(request);
ComponentDto project = db.components().insertPrivateProject();
ComponentDto branch = db.components().insertProjectBranch(project);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setProjectKeys(singletonList(branch.getKey()))
.setBranch(branch.getBranch())))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.projectUuids()), IssueQuery::isMainBranch)
.containsOnly(branch.uuid(), singletonList(project.uuid()), false);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setComponentKeys(singletonList(branch.getKey()))
.setBranch(branch.getBranch())))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.projectUuids()), IssueQuery::isMainBranch)
ComponentDto branch = db.components().insertProjectBranch(project);
ComponentDto file = db.components().insertComponent(newFileDto(branch));
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setComponentKeys(singletonList(file.getKey()))
.setBranch(branch.getBranch())))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.fileUuids()), IssueQuery::isMainBranch)
.containsOnly(branch.uuid(), singletonList(file.uuid()), false);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setComponentKeys(singletonList(branch.getKey()))
.setFileUuids(singletonList(file.uuid()))
.setBranch(branch.getBranch())))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.fileUuids()), IssueQuery::isMainBranch)
.containsOnly(branch.uuid(), singletonList(file.uuid()), false);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setProjectKeys(singletonList(branch.getKey()))
.setFileUuids(singletonList(file.uuid()))
.setBranch(branch.getBranch())))
ComponentDto branch = db.components().insertProjectBranch(project);
ComponentDto file = db.components().insertComponent(newFileDto(branch));
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setComponentKeys(singletonList(file.getKey()))
.setBranch(branch.getBranch())
.setOnComponentOnly(true)))
ComponentDto project = db.components().insertMainBranch();
ComponentDto branch = db.components().insertProjectBranch(project);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setProjectKeys(singletonList(project.getKey()))
.setBranch("master")))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.projectUuids()), IssueQuery::isMainBranch)
.containsOnly(project.uuid(), singletonList(project.uuid()), true);
- assertThat(underTest.create(new SearchWsRequest()
+ assertThat(underTest.create(new SearchRequest()
.setComponentKeys(singletonList(project.getKey()))
.setBranch("master")))
.extracting(IssueQuery::branchUuid, query -> new ArrayList<>(query.projectUuids()), IssueQuery::isMainBranch)
@Test
public void fail_if_created_after_and_created_since_are_both_set() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setCreatedAfter("2013-07-25T07:35:00+0100")
.setCreatedInLast("palap");
Date now = DateUtils.parseDateTime("2013-07-25T07:35:00+0100");
when(clock.instant()).thenReturn(now.toInstant());
when(clock.getZone()).thenReturn(ZoneOffset.UTC);
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setCreatedInLast("1y2m3w4d");
assertThat(underTest.create(request).createdAfter()).isEqualTo(DateUtils.parseDateTime("2012-04-30T07:35:00+0100"));
}
expectedException.expect(BadRequestException.class);
expectedException.expectMessage("Parameters 'createdAfter' and 'sinceLeakPeriod' cannot be set simultaneously");
- underTest.create(new SearchWsRequest()
+ underTest.create(new SearchRequest()
.setSinceLeakPeriod(true)
.setCreatedAfter("2013-07-25T07:35:00+0100"));
}
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("One and only one component must be provided when searching since leak period");
- underTest.create(new SearchWsRequest().setSinceLeakPeriod(true));
+ underTest.create(new SearchRequest().setSinceLeakPeriod(true));
}
@Test
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("One and only one component must be provided when searching since leak period");
- underTest.create(new SearchWsRequest()
+ underTest.create(new SearchRequest()
.setSinceLeakPeriod(true)
.setComponentKeys(asList(project1.getKey(), project2.getKey())));
}
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("'unknown-date' cannot be parsed as either a date or date+time");
- underTest.create(new SearchWsRequest()
+ underTest.create(new SearchRequest()
.setCreatedAfter("unknown-date"));
}
@Test
public void return_empty_results_if_organization_with_specified_key_does_not_exist() {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setOrganization("does_not_exist");
IssueQuery query = underTest.create(request);
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
.put("bug", 32L)
.put("cert", 2L)
.build();
- ArgumentCaptor<SearchWsRequest> captor = ArgumentCaptor.forClass(SearchWsRequest.class);
+ ArgumentCaptor<SearchRequest> captor = ArgumentCaptor.forClass(SearchRequest.class);
when(issueQueryFactory.create(captor.capture())).thenReturn(mock(IssueQuery.class));
when(service.countTags(any(IssueQuery.class), eq(5))).thenReturn(tags);
.put("bug", 32L)
.put("cert", 2L)
.build();
- ArgumentCaptor<SearchWsRequest> captor = ArgumentCaptor.forClass(SearchWsRequest.class);
+ ArgumentCaptor<SearchRequest> captor = ArgumentCaptor.forClass(SearchRequest.class);
when(issueQueryFactory.create(captor.capture())).thenReturn(mock(IssueQuery.class));
when(service.countTags(any(IssueQuery.class), eq(5))).thenReturn(tags);
import org.sonar.db.component.ComponentDto;
import org.sonar.db.measure.MeasureDto;
import org.sonar.db.metric.MetricDto;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Collections.singletonList;
@Test
public void sort_by_names() {
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(NAME_SORT), true, null);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(NAME_SORT), true, null);
List<ComponentDto> result = sortComponents(wsRequest);
assertThat(result).extracting("name")
@Test
public void sort_by_qualifier() {
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(QUALIFIER_SORT), false, null);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(QUALIFIER_SORT), false, null);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_path() {
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(PATH_SORT), true, null);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(PATH_SORT), true, null);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_numerical_metric_key_ascending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_SORT), true, NUM_METRIC_KEY);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_SORT), true, NUM_METRIC_KEY);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_numerical_metric_key_descending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, NUM_METRIC_KEY);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, NUM_METRIC_KEY);
List<ComponentDto> result = sortComponents(wsRequest);
newComponentWithoutSnapshotId("PROJECT 11", Qualifiers.PROJECT, "PROJECT_PATH_1"),
newComponentWithoutSnapshotId("PROJECT 0", Qualifiers.PROJECT, "PROJECT_PATH_2"));
- ComponentTreeWsRequest wsRequest = newRequest(newArrayList(PATH_SORT), false, null);
+ ComponentTreeRequest wsRequest = newRequest(newArrayList(PATH_SORT), false, null);
List<ComponentDto> result = sortComponents(wsRequest);
String alertStatus = statuses.get(i % 3);
measuresByComponentUuidAndMetric.put(component.uuid(), metrics.get(0), createFromMeasureDto(new MeasureDto().setData(alertStatus)));
}
- ComponentTreeWsRequest wsRequest = newRequest(newArrayList(METRIC_SORT, NAME_SORT), true, CoreMetrics.ALERT_STATUS_KEY);
+ ComponentTreeRequest wsRequest = newRequest(newArrayList(METRIC_SORT, NAME_SORT), true, CoreMetrics.ALERT_STATUS_KEY);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_numerical_metric_period_1_key_ascending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_PERIOD_SORT), true, NUM_METRIC_KEY).setMetricPeriodSort(1);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_PERIOD_SORT), true, NUM_METRIC_KEY).setMetricPeriodSort(1);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_numerical_metric_period_1_key_descending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_PERIOD_SORT), false, NUM_METRIC_KEY).setMetricPeriodSort(1);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_PERIOD_SORT), false, NUM_METRIC_KEY).setMetricPeriodSort(1);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_numerical_metric_period_5_key() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, NUM_METRIC_KEY).setMetricPeriodSort(5);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, NUM_METRIC_KEY).setMetricPeriodSort(5);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_textual_metric_key_ascending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_SORT), true, TEXT_METRIC_KEY);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_SORT), true, TEXT_METRIC_KEY);
List<ComponentDto> result = sortComponents(wsRequest);
@Test
public void sort_by_textual_metric_key_descending() {
components.add(newComponentWithoutSnapshotId("name-without-measure", "qualifier-without-measure", "path-without-measure"));
- ComponentTreeWsRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, TEXT_METRIC_KEY);
+ ComponentTreeRequest wsRequest = newRequest(singletonList(METRIC_SORT), false, TEXT_METRIC_KEY);
List<ComponentDto> result = sortComponents(wsRequest);
newComponentWithoutSnapshotId("name-1", "qualifier-1", "path-2"),
newComponentWithoutSnapshotId("name-1", "qualifier-1", "path-3"),
newComponentWithoutSnapshotId("name-1", "qualifier-1", "path-1"));
- ComponentTreeWsRequest wsRequest = newRequest(newArrayList(NAME_SORT, QUALIFIER_SORT, PATH_SORT), true, null);
+ ComponentTreeRequest wsRequest = newRequest(newArrayList(NAME_SORT, QUALIFIER_SORT, PATH_SORT), true, null);
List<ComponentDto> result = sortComponents(wsRequest);
.containsExactly("path-1", "path-2", "path-3");
}
- private List<ComponentDto> sortComponents(ComponentTreeWsRequest wsRequest) {
+ private List<ComponentDto> sortComponents(ComponentTreeRequest wsRequest) {
return ComponentTreeSort.sortComponents(components, wsRequest, metrics, measuresByComponentUuidAndMetric);
}
.setPath(path);
}
- private static ComponentTreeWsRequest newRequest(List<String> sortFields, boolean isAscending, @Nullable String metricKey) {
- return new ComponentTreeWsRequest()
+ private static ComponentTreeRequest newRequest(List<String> sortFields, boolean isAscending, @Nullable String metricKey) {
+ return new ComponentTreeRequest()
.setAsc(isAscending)
.setSort(sortFields)
.setMetricSort(metricKey);
import org.sonarqube.ws.Common.Paging;
import org.sonarqube.ws.Organizations.SearchMembersWsResponse;
import org.sonarqube.ws.Organizations.User;
-import org.sonarqube.ws.client.organization.SearchMembersWsRequest;
+import org.sonarqube.ws.client.organization.SearchMembersRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
private WsActionTester ws = new WsActionTester(new SearchMembersAction(dbClient, new UserIndex(es.client(), System2.INSTANCE), organizationProvider, userSession, new AvatarResolverImpl()));
- private SearchMembersWsRequest request = new SearchMembersWsRequest();
+ private SearchMembersRequest request = new SearchMembersRequest();
@Test
public void empty_response() {
import org.sonarqube.ws.Projects.SearchWsResponse;
import org.sonarqube.ws.Projects.SearchWsResponse.Component;
import org.sonarqube.ws.client.component.ComponentsWsParameters;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("PROJECT-_%-KEY"),
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("project-key-without-escaped-characters"));
- SearchWsResponse response = call(SearchWsRequest.builder().setQuery("JeCt-_%-k").build());
+ SearchWsResponse response = call(SearchRequest.builder().setQuery("JeCt-_%-k").build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("project-_%-key", "PROJECT-_%-KEY");
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("private-key"),
ComponentTesting.newPublicProjectDto(db.getDefaultOrganization()).setDbKey("public-key"));
- SearchWsResponse response = call(SearchWsRequest.builder().setVisibility("private").build());
+ SearchWsResponse response = call(SearchRequest.builder().setVisibility("private").build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("private-key");
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey("private-key"),
ComponentTesting.newPublicProjectDto(db.getDefaultOrganization()).setDbKey("public-key"));
- SearchWsResponse response = call(SearchWsRequest.builder().setVisibility("public").build());
+ SearchWsResponse response = call(SearchRequest.builder().setVisibility("public").build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("public-key");
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey(PROJECT_KEY_1),
newView(db.getDefaultOrganization()));
- SearchWsResponse response = call(SearchWsRequest.builder().build());
+ SearchWsResponse response = call(SearchRequest.builder().build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(PROJECT_KEY_1);
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey(PROJECT_KEY_2),
newView(db.getDefaultOrganization()));
- SearchWsResponse response = call(SearchWsRequest.builder().setQualifiers(singletonList("TRK")).build());
+ SearchWsResponse response = call(SearchRequest.builder().setQualifiers(singletonList("TRK")).build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(PROJECT_KEY_1, PROJECT_KEY_2);
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey(PROJECT_KEY_1),
newView(db.getDefaultOrganization()).setDbKey("view1"));
- SearchWsResponse response = call(SearchWsRequest.builder().setQualifiers(singletonList("VW")).build());
+ SearchWsResponse response = call(SearchRequest.builder().setQualifiers(singletonList("VW")).build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly("view1");
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey(PROJECT_KEY_1),
newView(db.getDefaultOrganization()).setDbKey("view1"));
- SearchWsResponse response = call(SearchWsRequest.builder().setQualifiers(asList("TRK", "VW")).build());
+ SearchWsResponse response = call(SearchRequest.builder().setQualifiers(asList("TRK", "VW")).build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(PROJECT_KEY_1, "view1");
}
ComponentTesting.newPrivateProjectDto(db.getDefaultOrganization()).setDbKey(PROJECT_KEY_2),
ComponentTesting.newPrivateProjectDto(otherOrganization).setDbKey(PROJECT_KEY_3));
- SearchWsResponse response = call(SearchWsRequest.builder().build());
+ SearchWsResponse response = call(SearchRequest.builder().build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(PROJECT_KEY_1, PROJECT_KEY_2);
}
ComponentDto project3 = ComponentTesting.newPrivateProjectDto(organization2);
db.components().insertComponents(project1, project2, project3);
- SearchWsResponse response = call(SearchWsRequest.builder().setOrganization(organization1.getKey()).build());
+ SearchWsResponse response = call(SearchRequest.builder().setOrganization(organization1.getKey()).build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(project1.getDbKey(), project2.getDbKey());
}
db.getDbClient().snapshotDao().insert(db.getSession(), newAnalysis(recentProject).setCreatedAt(recentTime));
db.commit();
- SearchWsResponse result = call(SearchWsRequest.builder().setAnalyzedBefore(formatDate(new Date(recentTime))).build());
+ SearchWsResponse result = call(SearchRequest.builder().setAnalyzedBefore(formatDate(new Date(recentTime))).build());
assertThat(result.getComponentsList()).extracting(Component::getKey)
.containsExactlyInAnyOrder(oldProject.getKey())
ComponentDto branch = db.components().insertProjectBranch(project);
userSession.addPermission(ADMINISTER, db.getDefaultOrganization());
- SearchWsResponse response = call(SearchWsRequest.builder().build());
+ SearchWsResponse response = call(SearchRequest.builder().build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsOnly(project.getDbKey());
}
}
db.components().insertComponents(componentDtoList.toArray(new ComponentDto[] {}));
- SearchWsResponse response = call(SearchWsRequest.builder().setPage(2).setPageSize(3).build());
+ SearchWsResponse response = call(SearchRequest.builder().setPage(2).setPageSize(3).build());
assertThat(response.getComponentsList()).extracting(Component::getKey).containsExactly("project-key-4", "project-key-5", "project-key-6");
}
ComponentDto analyzedProject = db.components().insertPrivateProject();
db.components().insertSnapshot(newAnalysis(analyzedProject));
- SearchWsResponse response = call(SearchWsRequest.builder().setOnProvisionedOnly(true).build());
+ SearchWsResponse response = call(SearchRequest.builder().setOnProvisionedOnly(true).build());
assertThat(response.getComponentsList()).extracting(Component::getKey)
.containsExactlyInAnyOrder(provisionedProject.getKey())
ComponentDto sonarqube = db.components().insertPrivateProject();
ComponentDto sonarlint = db.components().insertPrivateProject();
- SearchWsResponse result = call(SearchWsRequest.builder()
+ SearchWsResponse result = call(SearchRequest.builder()
.setProjects(Arrays.asList(jdk.getKey(), sonarqube.getKey()))
.build());
ComponentDto sonarqube = db.components().insertPrivateProject();
ComponentDto sonarlint = db.components().insertPrivateProject();
- SearchWsResponse result = call(SearchWsRequest.builder()
+ SearchWsResponse result = call(SearchRequest.builder()
.setProjectIds(Arrays.asList(jdk.uuid(), sonarqube.uuid()))
.build());
userSession.addPermission(ADMINISTER_QUALITY_PROFILES, db.getDefaultOrganization());
expectedException.expect(ForbiddenException.class);
- call(SearchWsRequest.builder().build());
+ call(SearchRequest.builder().build());
}
@Test
public void fail_on_unknown_organization() throws Exception {
expectedException.expect(NotFoundException.class);
- call(SearchWsRequest.builder().setOrganization("unknown").build());
+ call(SearchRequest.builder().setOrganization("unknown").build());
}
@Test
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Value of parameter 'qualifiers' (BRC) must be one of: [TRK, VW, APP]");
- call(SearchWsRequest.builder().setQualifiers(singletonList("BRC")).build());
+ call(SearchRequest.builder().setQualifiers(singletonList("BRC")).build());
}
@Test
assertJson(ws.getDef().responseExampleAsString()).isSimilarTo(response);
}
- private SearchWsResponse call(SearchWsRequest wsRequest) {
+ private SearchWsResponse call(SearchRequest wsRequest) {
TestRequest request = ws.newRequest();
setNullable(wsRequest.getOrganization(), organization -> request.setParam(PARAM_ORGANIZATION, organization));
List<String> qualifiers = wsRequest.getQualifiers();
super(wsConnector, CONTROLLER_COMPONENTS);
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
GetRequest get = new GetRequest(path(ACTION_SEARCH))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_QUALIFIERS, Joiner.on(",").join(request.getQualifiers()))
return call(get, SearchWsResponse.parser());
}
- public TreeWsResponse tree(TreeWsRequest request) {
+ public TreeWsResponse tree(TreeRequest request) {
GetRequest get = new GetRequest(path(ACTION_TREE))
.setParam(PARAM_COMPONENT_ID, request.getBaseComponentId())
.setParam("baseComponentKey", request.getBaseComponentKey())
return call(get, TreeWsResponse.parser());
}
- public ShowWsResponse show(ShowWsRequest request) {
+ public ShowWsResponse show(ShowRequest request) {
GetRequest get = new GetRequest(path(ACTION_SHOW))
.setParam(PARAM_COMPONENT_ID, request.getId())
.setParam(PARAM_COMPONENT, request.getKey())
return call(get, SearchProjectsWsResponse.parser());
}
- public WsResponse suggestions(SuggestionsWsRequest request) {
+ public WsResponse suggestions(SuggestionsRequest request) {
GetRequest get = new GetRequest(path(ACTION_SUGGESTIONS))
.setParam("more", request.getMore() == null ? null : request.getMore().toString())
.setParam("recentlyBrowsed", request.getRecentlyBrowsed().stream().collect(Collectors.joining(",")))
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.component;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class SearchRequest {
+ private String organization;
+ private List<String> qualifiers;
+ private Integer page;
+ private Integer pageSize;
+ private String query;
+ private String language;
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public SearchRequest setOrganization(@Nullable String organization) {
+ this.organization = organization;
+ return this;
+ }
+
+ public List<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ public SearchRequest setQualifiers(List<String> qualifiers) {
+ this.qualifiers = requireNonNull(qualifiers);
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public SearchRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public SearchRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public SearchRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public String getLanguage() {
+ return language;
+ }
+
+ public SearchRequest setLanguage(@Nullable String language) {
+ this.language = language;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.component;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class SearchWsRequest {
- private String organization;
- private List<String> qualifiers;
- private Integer page;
- private Integer pageSize;
- private String query;
- private String language;
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public SearchWsRequest setOrganization(@Nullable String organization) {
- this.organization = organization;
- return this;
- }
-
- public List<String> getQualifiers() {
- return qualifiers;
- }
-
- public SearchWsRequest setQualifiers(List<String> qualifiers) {
- this.qualifiers = requireNonNull(qualifiers);
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public SearchWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public SearchWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public SearchWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public String getLanguage() {
- return language;
- }
-
- public SearchWsRequest setLanguage(@Nullable String language) {
- this.language = language;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.component;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class ShowRequest {
+ private String id;
+ private String key;
+ private String branch;
+
+ @CheckForNull
+ public String getId() {
+ return id;
+ }
+
+ public ShowRequest setId(@Nullable String id) {
+ this.id = id;
+ return this;
+ }
+
+ @CheckForNull
+ public String getKey() {
+ return key;
+ }
+
+ public ShowRequest setKey(@Nullable String key) {
+ this.key = key;
+ return this;
+ }
+
+ @CheckForNull
+ public String getBranch() {
+ return branch;
+ }
+
+ public ShowRequest setBranch(@Nullable String branch) {
+ this.branch = branch;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.component;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class ShowWsRequest {
- private String id;
- private String key;
- private String branch;
-
- @CheckForNull
- public String getId() {
- return id;
- }
-
- public ShowWsRequest setId(@Nullable String id) {
- this.id = id;
- return this;
- }
-
- @CheckForNull
- public String getKey() {
- return key;
- }
-
- public ShowWsRequest setKey(@Nullable String key) {
- this.key = key;
- return this;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- public ShowWsRequest setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.component;
+
+import java.util.Collections;
+import java.util.List;
+
+public class SuggestionsRequest {
+
+ public static final int MAX_PAGE_SIZE = 500;
+ public static final int DEFAULT_PAGE_SIZE = 100;
+
+ public enum More {
+ VW,
+ SVW,
+ APP,
+ TRK,
+ BRC,
+ FIL,
+ UTS
+ }
+
+ private final More more;
+ private final List<String> recentlyBrowsed;
+ private final String s;
+
+ private SuggestionsRequest(Builder builder) {
+ this.more = builder.more;
+ this.recentlyBrowsed = builder.recentlyBrowsed;
+ this.s = builder.s;
+ }
+
+ public More getMore() {
+ return more;
+ }
+
+ public List<String> getRecentlyBrowsed() {
+ return recentlyBrowsed;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+
+ private More more;
+ private List<String> recentlyBrowsed = Collections.emptyList();
+ private String s;
+
+ private Builder() {
+ // enforce static factory method
+ }
+
+ public Builder setMore(More more) {
+ this.more = more;
+ return this;
+ }
+
+ public Builder setRecentlyBrowsed(List<String> recentlyBrowsed) {
+ this.recentlyBrowsed = recentlyBrowsed;
+ return this;
+ }
+
+ public Builder setS(String s) {
+ this.s = s;
+ return this;
+ }
+
+ public SuggestionsRequest build() {
+ return new SuggestionsRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.component;
-
-import java.util.Collections;
-import java.util.List;
-
-public class SuggestionsWsRequest {
-
- public static final int MAX_PAGE_SIZE = 500;
- public static final int DEFAULT_PAGE_SIZE = 100;
-
- public enum More {
- VW,
- SVW,
- APP,
- TRK,
- BRC,
- FIL,
- UTS
- }
-
- private final More more;
- private final List<String> recentlyBrowsed;
- private final String s;
-
- private SuggestionsWsRequest(Builder builder) {
- this.more = builder.more;
- this.recentlyBrowsed = builder.recentlyBrowsed;
- this.s = builder.s;
- }
-
- public More getMore() {
- return more;
- }
-
- public List<String> getRecentlyBrowsed() {
- return recentlyBrowsed;
- }
-
- public String getS() {
- return s;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
-
- private More more;
- private List<String> recentlyBrowsed = Collections.emptyList();
- private String s;
-
- private Builder() {
- // enforce static factory method
- }
-
- public Builder setMore(More more) {
- this.more = more;
- return this;
- }
-
- public Builder setRecentlyBrowsed(List<String> recentlyBrowsed) {
- this.recentlyBrowsed = recentlyBrowsed;
- return this;
- }
-
- public Builder setS(String s) {
- this.s = s;
- return this;
- }
-
- public SuggestionsWsRequest build() {
- return new SuggestionsWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.component;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class TreeRequest {
+ private String baseComponentId;
+ private String baseComponentKey;
+ private String component;
+ private String branch;
+ private String strategy;
+ private List<String> qualifiers;
+ private String query;
+ private List<String> sort;
+ private Boolean asc;
+ private Integer page;
+ private Integer pageSize;
+
+ /**
+ * @deprecated since 6.4, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getBaseComponentId() {
+ return baseComponentId;
+ }
+
+ /**
+ * @deprecated since 6.4, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public TreeRequest setBaseComponentId(@Nullable String baseComponentId) {
+ this.baseComponentId = baseComponentId;
+ return this;
+ }
+
+ /**
+ * @deprecated since 6.4, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getBaseComponentKey() {
+ return baseComponentKey;
+ }
+
+ /**
+ * @deprecated since 6.4, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public TreeRequest setBaseComponentKey(@Nullable String baseComponentKey) {
+ this.baseComponentKey = baseComponentKey;
+ return this;
+ }
+
+ public TreeRequest setComponent(@Nullable String component) {
+ this.component = component;
+ return this;
+ }
+
+ @CheckForNull
+ public String getComponent() {
+ return component;
+ }
+
+ @CheckForNull
+ public String getBranch() {
+ return branch;
+ }
+
+ public TreeRequest setBranch(@Nullable String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ @CheckForNull
+ public String getStrategy() {
+ return strategy;
+ }
+
+ public TreeRequest setStrategy(@Nullable String strategy) {
+ this.strategy = strategy;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ public TreeRequest setQualifiers(@Nullable List<String> qualifiers) {
+ this.qualifiers = qualifiers;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public TreeRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getSort() {
+ return sort;
+ }
+
+ public TreeRequest setSort(@Nullable List<String> sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ public Boolean getAsc() {
+ return asc;
+ }
+
+ public TreeRequest setAsc(@Nullable Boolean asc) {
+ this.asc = asc;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public TreeRequest setPage(@Nullable Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public TreeRequest setPageSize(@Nullable Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.component;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class TreeWsRequest {
- private String baseComponentId;
- private String baseComponentKey;
- private String component;
- private String branch;
- private String strategy;
- private List<String> qualifiers;
- private String query;
- private List<String> sort;
- private Boolean asc;
- private Integer page;
- private Integer pageSize;
-
- /**
- * @deprecated since 6.4, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getBaseComponentId() {
- return baseComponentId;
- }
-
- /**
- * @deprecated since 6.4, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public TreeWsRequest setBaseComponentId(@Nullable String baseComponentId) {
- this.baseComponentId = baseComponentId;
- return this;
- }
-
- /**
- * @deprecated since 6.4, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getBaseComponentKey() {
- return baseComponentKey;
- }
-
- /**
- * @deprecated since 6.4, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public TreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) {
- this.baseComponentKey = baseComponentKey;
- return this;
- }
-
- public TreeWsRequest setComponent(@Nullable String component) {
- this.component = component;
- return this;
- }
-
- @CheckForNull
- public String getComponent() {
- return component;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- public TreeWsRequest setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-
- @CheckForNull
- public String getStrategy() {
- return strategy;
- }
-
- public TreeWsRequest setStrategy(@Nullable String strategy) {
- this.strategy = strategy;
- return this;
- }
-
- @CheckForNull
- public List<String> getQualifiers() {
- return qualifiers;
- }
-
- public TreeWsRequest setQualifiers(@Nullable List<String> qualifiers) {
- this.qualifiers = qualifiers;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public TreeWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public List<String> getSort() {
- return sort;
- }
-
- public TreeWsRequest setSort(@Nullable List<String> sort) {
- this.sort = sort;
- return this;
- }
-
- public Boolean getAsc() {
- return asc;
- }
-
- public TreeWsRequest setAsc(@Nullable Boolean asc) {
- this.asc = asc;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public TreeWsRequest setPage(@Nullable Integer page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public TreeWsRequest setPageSize(@Nullable Integer pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-}
Issues.Operation.parser());
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
return call(
new GetRequest(path(ACTION_SEARCH))
.setParam(DEPRECATED_PARAM_ACTION_PLANS, inlineMultipleParamValue(request.getActionPlans()))
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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 java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchRequest {
+ private List<String> actionPlans;
+ private List<String> additionalFields;
+ private Boolean asc;
+ private Boolean assigned;
+ private List<String> assignees;
+ private List<String> authors;
+ private List<String> componentKeys;
+ private List<String> componentRootUuids;
+ private List<String> componentRoots;
+ private List<String> componentUuids;
+ private List<String> components;
+ private String createdAfter;
+ private String createdAt;
+ private String createdBefore;
+ private String createdInLast;
+ private List<String> directories;
+ private String facetMode;
+ private List<String> facets;
+ private List<String> fileUuids;
+ private List<String> issues;
+ private List<String> languages;
+ private List<String> moduleUuids;
+ private Boolean onComponentOnly;
+ private String branch;
+ private String organization;
+ private Integer page;
+ private Integer pageSize;
+ private List<String> projectKeys;
+ private List<String> projectUuids;
+ private List<String> projects;
+ private List<String> resolutions;
+ private Boolean resolved;
+ private List<String> rules;
+ private Boolean sinceLeakPeriod;
+ private String sort;
+ private List<String> severities;
+ private List<String> statuses;
+ private List<String> tags;
+ private List<String> types;
+
+ @CheckForNull
+ public List<String> getActionPlans() {
+ return actionPlans;
+ }
+
+ public SearchRequest setActionPlans(@Nullable List<String> actionPlans) {
+ this.actionPlans = actionPlans;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getAdditionalFields() {
+ return additionalFields;
+ }
+
+ public SearchRequest setAdditionalFields(@Nullable List<String> additionalFields) {
+ this.additionalFields = additionalFields;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getAsc() {
+ return asc;
+ }
+
+ public SearchRequest setAsc(boolean asc) {
+ this.asc = asc;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getAssigned() {
+ return assigned;
+ }
+
+ public SearchRequest setAssigned(@Nullable Boolean assigned) {
+ this.assigned = assigned;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getAssignees() {
+ return assignees;
+ }
+
+ public SearchRequest setAssignees(@Nullable List<String> assignees) {
+ this.assignees = assignees;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getAuthors() {
+ return authors;
+ }
+
+ public SearchRequest setAuthors(@Nullable List<String> authors) {
+ this.authors = authors;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getComponentKeys() {
+ return componentKeys;
+ }
+
+ public SearchRequest setComponentKeys(@Nullable List<String> componentKeys) {
+ this.componentKeys = componentKeys;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getComponentUuids() {
+ return componentUuids;
+ }
+
+ public SearchRequest setComponentUuids(@Nullable List<String> componentUuids) {
+ this.componentUuids = componentUuids;
+ return this;
+ }
+
+ @CheckForNull
+ public String getCreatedAfter() {
+ return createdAfter;
+ }
+
+ public SearchRequest setCreatedAfter(@Nullable String createdAfter) {
+ this.createdAfter = createdAfter;
+ return this;
+ }
+
+ @CheckForNull
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public SearchRequest setCreatedAt(@Nullable String createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ @CheckForNull
+ public String getCreatedBefore() {
+ return createdBefore;
+ }
+
+ public SearchRequest setCreatedBefore(@Nullable String createdBefore) {
+ this.createdBefore = createdBefore;
+ return this;
+ }
+
+ @CheckForNull
+ public String getCreatedInLast() {
+ return createdInLast;
+ }
+
+ public SearchRequest setCreatedInLast(@Nullable String createdInLast) {
+ this.createdInLast = createdInLast;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getDirectories() {
+ return directories;
+ }
+
+ public SearchRequest setDirectories(@Nullable List<String> directories) {
+ this.directories = directories;
+ return this;
+ }
+
+ @CheckForNull
+ public String getFacetMode() {
+ return facetMode;
+ }
+
+ public SearchRequest setFacetMode(@Nullable String facetMode) {
+ this.facetMode = facetMode;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getFacets() {
+ return facets;
+ }
+
+ public SearchRequest setFacets(@Nullable List<String> facets) {
+ this.facets = facets;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getFileUuids() {
+ return fileUuids;
+ }
+
+ public SearchRequest setFileUuids(@Nullable List<String> fileUuids) {
+ this.fileUuids = fileUuids;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getIssues() {
+ return issues;
+ }
+
+ public SearchRequest setIssues(@Nullable List<String> issues) {
+ this.issues = issues;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getLanguages() {
+ return languages;
+ }
+
+ public SearchRequest setLanguages(@Nullable List<String> languages) {
+ this.languages = languages;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getModuleUuids() {
+ return moduleUuids;
+ }
+
+ public SearchRequest setModuleUuids(@Nullable List<String> moduleUuids) {
+ this.moduleUuids = moduleUuids;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getOnComponentOnly() {
+ return onComponentOnly;
+ }
+
+ public SearchRequest setOnComponentOnly(Boolean onComponentOnly) {
+ this.onComponentOnly = onComponentOnly;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public SearchRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public SearchRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public SearchRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getProjectKeys() {
+ return projectKeys;
+ }
+
+ public SearchRequest setProjectKeys(@Nullable List<String> projectKeys) {
+ this.projectKeys = projectKeys;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getProjectUuids() {
+ return projectUuids;
+ }
+
+ public SearchRequest setProjectUuids(@Nullable List<String> projectUuids) {
+ this.projectUuids = projectUuids;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getResolutions() {
+ return resolutions;
+ }
+
+ public SearchRequest setResolutions(@Nullable List<String> resolutions) {
+ this.resolutions = resolutions;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getResolved() {
+ return resolved;
+ }
+
+ public SearchRequest setResolved(@Nullable Boolean resolved) {
+ this.resolved = resolved;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getRules() {
+ return rules;
+ }
+
+ public SearchRequest setRules(@Nullable List<String> rules) {
+ this.rules = rules;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getSinceLeakPeriod() {
+ return sinceLeakPeriod;
+ }
+
+ public SearchRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) {
+ this.sinceLeakPeriod = sinceLeakPeriod;
+ return this;
+ }
+
+ @CheckForNull
+ public String getSort() {
+ return sort;
+ }
+
+ public SearchRequest setSort(@Nullable String sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getSeverities() {
+ return severities;
+ }
+
+ public SearchRequest setSeverities(@Nullable List<String> severities) {
+ this.severities = severities;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getStatuses() {
+ return statuses;
+ }
+
+ public SearchRequest setStatuses(@Nullable List<String> statuses) {
+ this.statuses = statuses;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getTags() {
+ return tags;
+ }
+
+ public SearchRequest setTags(@Nullable List<String> tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getTypes() {
+ return types;
+ }
+
+ public SearchRequest setTypes(@Nullable List<String> types) {
+ this.types = types;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getComponentRootUuids() {
+ return componentRootUuids;
+ }
+
+ public SearchRequest setComponentRootUuids(List<String> componentRootUuids) {
+ this.componentRootUuids = componentRootUuids;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getComponentRoots() {
+ return componentRoots;
+ }
+
+ public SearchRequest setComponentRoots(@Nullable List<String> componentRoots) {
+ this.componentRoots = componentRoots;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getComponents() {
+ return components;
+ }
+
+ public SearchRequest setComponents(@Nullable List<String> components) {
+ this.components = components;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getProjects() {
+ return projects;
+ }
+
+ public SearchRequest setProjects(@Nullable List<String> projects) {
+ this.projects = projects;
+ return this;
+ }
+
+ @CheckForNull
+ public String getBranch() {
+ return branch;
+ }
+
+ public SearchRequest setBranch(@Nullable String branch) {
+ this.branch = branch;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchWsRequest {
- private List<String> actionPlans;
- private List<String> additionalFields;
- private Boolean asc;
- private Boolean assigned;
- private List<String> assignees;
- private List<String> authors;
- private List<String> componentKeys;
- private List<String> componentRootUuids;
- private List<String> componentRoots;
- private List<String> componentUuids;
- private List<String> components;
- private String createdAfter;
- private String createdAt;
- private String createdBefore;
- private String createdInLast;
- private List<String> directories;
- private String facetMode;
- private List<String> facets;
- private List<String> fileUuids;
- private List<String> issues;
- private List<String> languages;
- private List<String> moduleUuids;
- private Boolean onComponentOnly;
- private String branch;
- private String organization;
- private Integer page;
- private Integer pageSize;
- private List<String> projectKeys;
- private List<String> projectUuids;
- private List<String> projects;
- private List<String> resolutions;
- private Boolean resolved;
- private List<String> rules;
- private Boolean sinceLeakPeriod;
- private String sort;
- private List<String> severities;
- private List<String> statuses;
- private List<String> tags;
- private List<String> types;
-
- @CheckForNull
- public List<String> getActionPlans() {
- return actionPlans;
- }
-
- public SearchWsRequest setActionPlans(@Nullable List<String> actionPlans) {
- this.actionPlans = actionPlans;
- return this;
- }
-
- @CheckForNull
- public List<String> getAdditionalFields() {
- return additionalFields;
- }
-
- public SearchWsRequest setAdditionalFields(@Nullable List<String> additionalFields) {
- this.additionalFields = additionalFields;
- return this;
- }
-
- @CheckForNull
- public Boolean getAsc() {
- return asc;
- }
-
- public SearchWsRequest setAsc(boolean asc) {
- this.asc = asc;
- return this;
- }
-
- @CheckForNull
- public Boolean getAssigned() {
- return assigned;
- }
-
- public SearchWsRequest setAssigned(@Nullable Boolean assigned) {
- this.assigned = assigned;
- return this;
- }
-
- @CheckForNull
- public List<String> getAssignees() {
- return assignees;
- }
-
- public SearchWsRequest setAssignees(@Nullable List<String> assignees) {
- this.assignees = assignees;
- return this;
- }
-
- @CheckForNull
- public List<String> getAuthors() {
- return authors;
- }
-
- public SearchWsRequest setAuthors(@Nullable List<String> authors) {
- this.authors = authors;
- return this;
- }
-
- @CheckForNull
- public List<String> getComponentKeys() {
- return componentKeys;
- }
-
- public SearchWsRequest setComponentKeys(@Nullable List<String> componentKeys) {
- this.componentKeys = componentKeys;
- return this;
- }
-
- @CheckForNull
- public List<String> getComponentUuids() {
- return componentUuids;
- }
-
- public SearchWsRequest setComponentUuids(@Nullable List<String> componentUuids) {
- this.componentUuids = componentUuids;
- return this;
- }
-
- @CheckForNull
- public String getCreatedAfter() {
- return createdAfter;
- }
-
- public SearchWsRequest setCreatedAfter(@Nullable String createdAfter) {
- this.createdAfter = createdAfter;
- return this;
- }
-
- @CheckForNull
- public String getCreatedAt() {
- return createdAt;
- }
-
- public SearchWsRequest setCreatedAt(@Nullable String createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- @CheckForNull
- public String getCreatedBefore() {
- return createdBefore;
- }
-
- public SearchWsRequest setCreatedBefore(@Nullable String createdBefore) {
- this.createdBefore = createdBefore;
- return this;
- }
-
- @CheckForNull
- public String getCreatedInLast() {
- return createdInLast;
- }
-
- public SearchWsRequest setCreatedInLast(@Nullable String createdInLast) {
- this.createdInLast = createdInLast;
- return this;
- }
-
- @CheckForNull
- public List<String> getDirectories() {
- return directories;
- }
-
- public SearchWsRequest setDirectories(@Nullable List<String> directories) {
- this.directories = directories;
- return this;
- }
-
- @CheckForNull
- public String getFacetMode() {
- return facetMode;
- }
-
- public SearchWsRequest setFacetMode(@Nullable String facetMode) {
- this.facetMode = facetMode;
- return this;
- }
-
- @CheckForNull
- public List<String> getFacets() {
- return facets;
- }
-
- public SearchWsRequest setFacets(@Nullable List<String> facets) {
- this.facets = facets;
- return this;
- }
-
- @CheckForNull
- public List<String> getFileUuids() {
- return fileUuids;
- }
-
- public SearchWsRequest setFileUuids(@Nullable List<String> fileUuids) {
- this.fileUuids = fileUuids;
- return this;
- }
-
- @CheckForNull
- public List<String> getIssues() {
- return issues;
- }
-
- public SearchWsRequest setIssues(@Nullable List<String> issues) {
- this.issues = issues;
- return this;
- }
-
- @CheckForNull
- public List<String> getLanguages() {
- return languages;
- }
-
- public SearchWsRequest setLanguages(@Nullable List<String> languages) {
- this.languages = languages;
- return this;
- }
-
- @CheckForNull
- public List<String> getModuleUuids() {
- return moduleUuids;
- }
-
- public SearchWsRequest setModuleUuids(@Nullable List<String> moduleUuids) {
- this.moduleUuids = moduleUuids;
- return this;
- }
-
- @CheckForNull
- public Boolean getOnComponentOnly() {
- return onComponentOnly;
- }
-
- public SearchWsRequest setOnComponentOnly(Boolean onComponentOnly) {
- this.onComponentOnly = onComponentOnly;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public SearchWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public SearchWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public SearchWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- @CheckForNull
- public List<String> getProjectKeys() {
- return projectKeys;
- }
-
- public SearchWsRequest setProjectKeys(@Nullable List<String> projectKeys) {
- this.projectKeys = projectKeys;
- return this;
- }
-
- @CheckForNull
- public List<String> getProjectUuids() {
- return projectUuids;
- }
-
- public SearchWsRequest setProjectUuids(@Nullable List<String> projectUuids) {
- this.projectUuids = projectUuids;
- return this;
- }
-
- @CheckForNull
- public List<String> getResolutions() {
- return resolutions;
- }
-
- public SearchWsRequest setResolutions(@Nullable List<String> resolutions) {
- this.resolutions = resolutions;
- return this;
- }
-
- @CheckForNull
- public Boolean getResolved() {
- return resolved;
- }
-
- public SearchWsRequest setResolved(@Nullable Boolean resolved) {
- this.resolved = resolved;
- return this;
- }
-
- @CheckForNull
- public List<String> getRules() {
- return rules;
- }
-
- public SearchWsRequest setRules(@Nullable List<String> rules) {
- this.rules = rules;
- return this;
- }
-
- @CheckForNull
- public Boolean getSinceLeakPeriod() {
- return sinceLeakPeriod;
- }
-
- public SearchWsRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) {
- this.sinceLeakPeriod = sinceLeakPeriod;
- return this;
- }
-
- @CheckForNull
- public String getSort() {
- return sort;
- }
-
- public SearchWsRequest setSort(@Nullable String sort) {
- this.sort = sort;
- return this;
- }
-
- @CheckForNull
- public List<String> getSeverities() {
- return severities;
- }
-
- public SearchWsRequest setSeverities(@Nullable List<String> severities) {
- this.severities = severities;
- return this;
- }
-
- @CheckForNull
- public List<String> getStatuses() {
- return statuses;
- }
-
- public SearchWsRequest setStatuses(@Nullable List<String> statuses) {
- this.statuses = statuses;
- return this;
- }
-
- @CheckForNull
- public List<String> getTags() {
- return tags;
- }
-
- public SearchWsRequest setTags(@Nullable List<String> tags) {
- this.tags = tags;
- return this;
- }
-
- @CheckForNull
- public List<String> getTypes() {
- return types;
- }
-
- public SearchWsRequest setTypes(@Nullable List<String> types) {
- this.types = types;
- return this;
- }
-
- @CheckForNull
- public List<String> getComponentRootUuids() {
- return componentRootUuids;
- }
-
- public SearchWsRequest setComponentRootUuids(List<String> componentRootUuids) {
- this.componentRootUuids = componentRootUuids;
- return this;
- }
-
- @CheckForNull
- public List<String> getComponentRoots() {
- return componentRoots;
- }
-
- public SearchWsRequest setComponentRoots(@Nullable List<String> componentRoots) {
- this.componentRoots = componentRoots;
- return this;
- }
-
- @CheckForNull
- public List<String> getComponents() {
- return components;
- }
-
- public SearchWsRequest setComponents(@Nullable List<String> components) {
- this.components = components;
- return this;
- }
-
- @CheckForNull
- public List<String> getProjects() {
- return projects;
- }
-
- public SearchWsRequest setProjects(@Nullable List<String> projects) {
- this.projects = projects;
- return this;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- public SearchWsRequest setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.measure;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class ComponentRequest {
+ private String componentId;
+ private String componentKey;
+ private String component;
+ private String branch;
+ private List<String> metricKeys;
+ private List<String> additionalFields;
+ private String developerId;
+ private String developerKey;
+
+ /**
+ * @deprecated since 6.6, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getComponentId() {
+ return componentId;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public ComponentRequest setComponentId(@Nullable String componentId) {
+ this.componentId = componentId;
+ return this;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getComponentKey() {
+ return componentKey;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public ComponentRequest setComponentKey(@Nullable String componentKey) {
+ this.componentKey = componentKey;
+ return this;
+ }
+
+ @CheckForNull
+ public String getComponent() {
+ return component;
+ }
+
+ public ComponentRequest setComponent(@Nullable String component) {
+ this.component = component;
+ return this;
+ }
+
+ @CheckForNull
+ public String getBranch() {
+ return branch;
+ }
+
+ public ComponentRequest setBranch(@Nullable String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public List<String> getMetricKeys() {
+ return metricKeys;
+ }
+
+ public ComponentRequest setMetricKeys(@Nullable List<String> metricKeys) {
+ this.metricKeys = metricKeys;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getAdditionalFields() {
+ return additionalFields;
+ }
+
+ public ComponentRequest setAdditionalFields(@Nullable List<String> additionalFields) {
+ this.additionalFields = additionalFields;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDeveloperId() {
+ return developerId;
+ }
+
+ public ComponentRequest setDeveloperId(@Nullable String developerId) {
+ this.developerId = developerId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDeveloperKey() {
+ return developerKey;
+ }
+
+ public ComponentRequest setDeveloperKey(@Nullable String developerKey) {
+ this.developerKey = developerKey;
+ return this;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.measure;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class ComponentTreeRequest {
+
+ private String baseComponentId;
+ private String baseComponentKey;
+ private String component;
+ private String branch;
+ private String strategy;
+ private List<String> qualifiers;
+ private List<String> additionalFields;
+ private String query;
+ private List<String> sort;
+ private Boolean asc;
+ private String metricSort;
+ private Integer metricPeriodSort;
+ private String metricSortFilter;
+ private List<String> metricKeys;
+ private Integer page;
+ private Integer pageSize;
+ private String developerId;
+ private String developerKey;
+
+ /**
+ * @deprecated since 6.6, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getBaseComponentId() {
+ return baseComponentId;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public ComponentTreeRequest setBaseComponentId(@Nullable String baseComponentId) {
+ this.baseComponentId = baseComponentId;
+ return this;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #getComponent()} instead
+ */
+ @Deprecated
+ @CheckForNull
+ public String getBaseComponentKey() {
+ return baseComponentKey;
+ }
+
+ /**
+ * @deprecated since 6.6, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
+ public ComponentTreeRequest setBaseComponentKey(@Nullable String baseComponentKey) {
+ this.baseComponentKey = baseComponentKey;
+ return this;
+ }
+
+ @CheckForNull
+ public String getComponent() {
+ return component;
+ }
+
+ public ComponentTreeRequest setComponent(@Nullable String component) {
+ this.component = component;
+ return this;
+ }
+
+ @CheckForNull
+ public String getBranch() {
+ return branch;
+ }
+
+ public ComponentTreeRequest setBranch(@Nullable String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ @CheckForNull
+ public String getStrategy() {
+ return strategy;
+ }
+
+ public ComponentTreeRequest setStrategy(String strategy) {
+ this.strategy = strategy;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ public ComponentTreeRequest setQualifiers(@Nullable List<String> qualifiers) {
+ this.qualifiers = qualifiers;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getAdditionalFields() {
+ return additionalFields;
+ }
+
+ public ComponentTreeRequest setAdditionalFields(@Nullable List<String> additionalFields) {
+ this.additionalFields = additionalFields;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public ComponentTreeRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getSort() {
+ return sort;
+ }
+
+ public ComponentTreeRequest setSort(@Nullable List<String> sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ @CheckForNull
+ public String getMetricSort() {
+ return metricSort;
+ }
+
+ public ComponentTreeRequest setMetricSort(@Nullable String metricSort) {
+ this.metricSort = metricSort;
+ return this;
+ }
+
+ @CheckForNull
+ public String getMetricSortFilter() {
+ return metricSortFilter;
+ }
+
+ public ComponentTreeRequest setMetricSortFilter(@Nullable String metricSortFilter) {
+ this.metricSortFilter = metricSortFilter;
+ return this;
+ }
+
+ @CheckForNull
+ public List<String> getMetricKeys() {
+ return metricKeys;
+ }
+
+ public ComponentTreeRequest setMetricKeys(List<String> metricKeys) {
+ this.metricKeys = metricKeys;
+ return this;
+ }
+
+ @CheckForNull
+ public Boolean getAsc() {
+ return asc;
+ }
+
+ public ComponentTreeRequest setAsc(@Nullable Boolean asc) {
+ this.asc = asc;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public ComponentTreeRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public ComponentTreeRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getMetricPeriodSort() {
+ return metricPeriodSort;
+ }
+
+ public ComponentTreeRequest setMetricPeriodSort(@Nullable Integer metricPeriodSort) {
+ this.metricPeriodSort = metricPeriodSort;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDeveloperId() {
+ return developerId;
+ }
+
+ public ComponentTreeRequest setDeveloperId(@Nullable String developerId) {
+ this.developerId = developerId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDeveloperKey() {
+ return developerKey;
+ }
+
+ public ComponentTreeRequest setDeveloperKey(@Nullable String developerKey) {
+ this.developerKey = developerKey;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.measure;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class ComponentTreeWsRequest {
-
- private String baseComponentId;
- private String baseComponentKey;
- private String component;
- private String branch;
- private String strategy;
- private List<String> qualifiers;
- private List<String> additionalFields;
- private String query;
- private List<String> sort;
- private Boolean asc;
- private String metricSort;
- private Integer metricPeriodSort;
- private String metricSortFilter;
- private List<String> metricKeys;
- private Integer page;
- private Integer pageSize;
- private String developerId;
- private String developerKey;
-
- /**
- * @deprecated since 6.6, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getBaseComponentId() {
- return baseComponentId;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public ComponentTreeWsRequest setBaseComponentId(@Nullable String baseComponentId) {
- this.baseComponentId = baseComponentId;
- return this;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getBaseComponentKey() {
- return baseComponentKey;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) {
- this.baseComponentKey = baseComponentKey;
- return this;
- }
-
- @CheckForNull
- public String getComponent() {
- return component;
- }
-
- public ComponentTreeWsRequest setComponent(@Nullable String component) {
- this.component = component;
- return this;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- public ComponentTreeWsRequest setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-
- @CheckForNull
- public String getStrategy() {
- return strategy;
- }
-
- public ComponentTreeWsRequest setStrategy(String strategy) {
- this.strategy = strategy;
- return this;
- }
-
- @CheckForNull
- public List<String> getQualifiers() {
- return qualifiers;
- }
-
- public ComponentTreeWsRequest setQualifiers(@Nullable List<String> qualifiers) {
- this.qualifiers = qualifiers;
- return this;
- }
-
- @CheckForNull
- public List<String> getAdditionalFields() {
- return additionalFields;
- }
-
- public ComponentTreeWsRequest setAdditionalFields(@Nullable List<String> additionalFields) {
- this.additionalFields = additionalFields;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public ComponentTreeWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public List<String> getSort() {
- return sort;
- }
-
- public ComponentTreeWsRequest setSort(@Nullable List<String> sort) {
- this.sort = sort;
- return this;
- }
-
- @CheckForNull
- public String getMetricSort() {
- return metricSort;
- }
-
- public ComponentTreeWsRequest setMetricSort(@Nullable String metricSort) {
- this.metricSort = metricSort;
- return this;
- }
-
- @CheckForNull
- public String getMetricSortFilter() {
- return metricSortFilter;
- }
-
- public ComponentTreeWsRequest setMetricSortFilter(@Nullable String metricSortFilter) {
- this.metricSortFilter = metricSortFilter;
- return this;
- }
-
- @CheckForNull
- public List<String> getMetricKeys() {
- return metricKeys;
- }
-
- public ComponentTreeWsRequest setMetricKeys(List<String> metricKeys) {
- this.metricKeys = metricKeys;
- return this;
- }
-
- @CheckForNull
- public Boolean getAsc() {
- return asc;
- }
-
- public ComponentTreeWsRequest setAsc(@Nullable Boolean asc) {
- this.asc = asc;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public ComponentTreeWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public ComponentTreeWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- @CheckForNull
- public Integer getMetricPeriodSort() {
- return metricPeriodSort;
- }
-
- public ComponentTreeWsRequest setMetricPeriodSort(@Nullable Integer metricPeriodSort) {
- this.metricPeriodSort = metricPeriodSort;
- return this;
- }
-
- @CheckForNull
- public String getDeveloperId() {
- return developerId;
- }
-
- public ComponentTreeWsRequest setDeveloperId(@Nullable String developerId) {
- this.developerId = developerId;
- return this;
- }
-
- @CheckForNull
- public String getDeveloperKey() {
- return developerKey;
- }
-
- public ComponentTreeWsRequest setDeveloperKey(@Nullable String developerKey) {
- this.developerKey = developerKey;
- return this;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.measure;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class ComponentWsRequest {
- private String componentId;
- private String componentKey;
- private String component;
- private String branch;
- private List<String> metricKeys;
- private List<String> additionalFields;
- private String developerId;
- private String developerKey;
-
- /**
- * @deprecated since 6.6, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getComponentId() {
- return componentId;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public ComponentWsRequest setComponentId(@Nullable String componentId) {
- this.componentId = componentId;
- return this;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #getComponent()} instead
- */
- @Deprecated
- @CheckForNull
- public String getComponentKey() {
- return componentKey;
- }
-
- /**
- * @deprecated since 6.6, please use {@link #setComponent(String)} instead
- */
- @Deprecated
- public ComponentWsRequest setComponentKey(@Nullable String componentKey) {
- this.componentKey = componentKey;
- return this;
- }
-
- @CheckForNull
- public String getComponent() {
- return component;
- }
-
- public ComponentWsRequest setComponent(@Nullable String component) {
- this.component = component;
- return this;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- public ComponentWsRequest setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-
- public List<String> getMetricKeys() {
- return metricKeys;
- }
-
- public ComponentWsRequest setMetricKeys(@Nullable List<String> metricKeys) {
- this.metricKeys = metricKeys;
- return this;
- }
-
- @CheckForNull
- public List<String> getAdditionalFields() {
- return additionalFields;
- }
-
- public ComponentWsRequest setAdditionalFields(@Nullable List<String> additionalFields) {
- this.additionalFields = additionalFields;
- return this;
- }
-
- @CheckForNull
- public String getDeveloperId() {
- return developerId;
- }
-
- public ComponentWsRequest setDeveloperId(@Nullable String developerId) {
- this.developerId = developerId;
- return this;
- }
-
- @CheckForNull
- public String getDeveloperKey() {
- return developerKey;
- }
-
- public ComponentWsRequest setDeveloperKey(@Nullable String developerKey) {
- this.developerKey = developerKey;
- return this;
- }
-}
super(wsConnector, CONTROLLER_MEASURES);
}
- public ComponentTreeWsResponse componentTree(ComponentTreeWsRequest request) {
+ public ComponentTreeWsResponse componentTree(ComponentTreeRequest request) {
GetRequest getRequest = new GetRequest(path(ACTION_COMPONENT_TREE))
.setParam(DEPRECATED_PARAM_BASE_COMPONENT_ID, request.getBaseComponentId())
.setParam(DEPRECATED_PARAM_BASE_COMPONENT_KEY, request.getBaseComponentKey())
return call(getRequest, ComponentTreeWsResponse.parser());
}
- public ComponentWsResponse component(ComponentWsRequest request) {
+ public ComponentWsResponse component(ComponentRequest request) {
GetRequest getRequest = new GetRequest(path(ACTION_COMPONENT))
.setParam(DEPRECATED_PARAM_COMPONENT_ID, request.getComponentId())
.setParam(DEPRECATED_PARAM_COMPONENT_KEY, request.getComponentKey())
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.organization;
+
+import javax.annotation.concurrent.Immutable;
+
+@Immutable
+public class CreateRequest {
+ private final String name;
+ private final String key;
+ private final String description;
+ private final String url;
+ private final String avatar;
+
+ private CreateRequest(Builder builder) {
+ this.name = builder.name;
+ this.key = builder.key;
+ this.description = builder.description;
+ this.url = builder.url;
+ this.avatar = builder.avatar;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String name;
+ private String key;
+ private String description;
+ private String url;
+ private String avatar;
+
+ public Builder setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder setKey(String key) {
+ this.key = key;
+ return this;
+ }
+
+ public Builder setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ public Builder setUrl(String url) {
+ this.url = url;
+ return this;
+ }
+
+ public Builder setAvatar(String avatar) {
+ this.avatar = avatar;
+ return this;
+ }
+
+ public CreateRequest build() {
+ return new CreateRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.organization;
-
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class CreateWsRequest {
- private final String name;
- private final String key;
- private final String description;
- private final String url;
- private final String avatar;
-
- private CreateWsRequest(Builder builder) {
- this.name = builder.name;
- this.key = builder.key;
- this.description = builder.description;
- this.url = builder.url;
- this.avatar = builder.avatar;
- }
-
- public String getName() {
- return name;
- }
-
- public String getKey() {
- return key;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getUrl() {
- return url;
- }
-
- public String getAvatar() {
- return avatar;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String name;
- private String key;
- private String description;
- private String url;
- private String avatar;
-
- public Builder setName(String name) {
- this.name = name;
- return this;
- }
-
- public Builder setKey(String key) {
- this.key = key;
- return this;
- }
-
- public Builder setDescription(String description) {
- this.description = description;
- return this;
- }
-
- public Builder setUrl(String url) {
- this.url = url;
- return this;
- }
-
- public Builder setAvatar(String avatar) {
- this.avatar = avatar;
- return this;
- }
-
- public CreateWsRequest build() {
- return new CreateWsRequest(this);
- }
- }
-}
super(wsConnector, "api/organizations");
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
GetRequest get = new GetRequest(path("search"))
.setParam("organizations", inlineMultipleParamValue(request.getOrganizations()))
.setParam(PAGE, request.getPage())
return call(get, SearchWsResponse.parser());
}
- public CreateWsResponse create(CreateWsRequest request) {
+ public CreateWsResponse create(CreateRequest request) {
PostRequest post = new PostRequest(path("create"))
.setParam("name", request.getName())
.setParam("key", request.getKey())
return call(post, CreateWsResponse.parser());
}
- public UpdateWsResponse update(UpdateWsRequest request) {
+ public UpdateWsResponse update(UpdateRequest request) {
PostRequest post = new PostRequest(path("update"))
.setParam("key", request.getKey())
.setParam("name", request.getName())
call(post).failIfNotSuccessful();
}
- public SearchMembersWsResponse searchMembers(SearchMembersWsRequest request) {
+ public SearchMembersWsResponse searchMembers(SearchMembersRequest request) {
GetRequest get = new GetRequest(path("search_members"))
.setParam("organization", request.getOrganization())
.setParam("selected", request.getSelected())
call(post);
}
- public void updateProjectVisibility(UpdateProjectVisibilityWsRequest request) {
+ public void updateProjectVisibility(UpdateProjectVisibilityRequest request) {
PostRequest post = new PostRequest(path("update_project_visibility"))
.setParam("organization", request.getOrganization())
.setParam("projectVisibility", request.getProjectVisibility());
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.organization;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchMembersRequest {
+ private String organization;
+ private String selected;
+ private String query;
+ private Integer page;
+ private Integer pageSize;
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public SearchMembersRequest setOrganization(@Nullable String organization) {
+ this.organization = organization;
+ return this;
+ }
+
+ @CheckForNull
+ public String getSelected() {
+ return selected;
+ }
+
+ public SearchMembersRequest setSelected(@Nullable String selected) {
+ this.selected = selected;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public SearchMembersRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public SearchMembersRequest setPage(@Nullable Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public SearchMembersRequest setPageSize(@Nullable Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.organization;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchMembersWsRequest {
- private String organization;
- private String selected;
- private String query;
- private Integer page;
- private Integer pageSize;
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public SearchMembersWsRequest setOrganization(@Nullable String organization) {
- this.organization = organization;
- return this;
- }
-
- @CheckForNull
- public String getSelected() {
- return selected;
- }
-
- public SearchMembersWsRequest setSelected(@Nullable String selected) {
- this.selected = selected;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public SearchMembersWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public SearchMembersWsRequest setPage(@Nullable Integer page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public SearchMembersWsRequest setPageSize(@Nullable Integer pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.organization;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import static java.util.Arrays.asList;
+
+@Immutable
+public class SearchRequest {
+ private final Integer page;
+ private final Integer pageSize;
+ private final List<String> organizations;
+
+ private SearchRequest(Builder builder) {
+ this.page = builder.page;
+ this.pageSize = builder.pageSize;
+ this.organizations = builder.organizations;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ @CheckForNull
+ public List<String> getOrganizations() {
+ return organizations;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static final class Builder {
+ private Integer page;
+ private Integer pageSize;
+ private List<String> organizations;
+
+ public Builder setPage(@Nullable Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ public Builder setPageSize(@Nullable Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ public Builder setOrganizations(String... organizations) {
+ this.organizations = asList(organizations);
+ return this;
+ }
+
+ public SearchRequest build() {
+ return new SearchRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.organization;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static java.util.Arrays.asList;
-
-@Immutable
-public class SearchWsRequest {
- private final Integer page;
- private final Integer pageSize;
- private final List<String> organizations;
-
- private SearchWsRequest(Builder builder) {
- this.page = builder.page;
- this.pageSize = builder.pageSize;
- this.organizations = builder.organizations;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- @CheckForNull
- public List<String> getOrganizations() {
- return organizations;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static final class Builder {
- private Integer page;
- private Integer pageSize;
- private List<String> organizations;
-
- public Builder setPage(@Nullable Integer page) {
- this.page = page;
- return this;
- }
-
- public Builder setPageSize(@Nullable Integer pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- public Builder setOrganizations(String... organizations) {
- this.organizations = asList(organizations);
- return this;
- }
-
- public SearchWsRequest build() {
- return new SearchWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.organization;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+@Immutable
+public class UpdateProjectVisibilityRequest {
+ private final String organization;
+ private final String projectVisibility;
+
+ private UpdateProjectVisibilityRequest(Builder builder) {
+ this.organization = builder.organization;
+ this.projectVisibility = builder.projectVisibility;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ @CheckForNull
+ public String getProjectVisibility() {
+ return projectVisibility;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String organization;
+ private String projectVisibility;
+
+ public Builder setOrganization(@Nullable String organization) {
+ this.organization = organization;
+ return this;
+ }
+
+ public Builder setProjectVisibility(@Nullable String projectVisibility) {
+ this.projectVisibility = projectVisibility;
+ return this;
+ }
+
+ public UpdateProjectVisibilityRequest build() {
+ return new UpdateProjectVisibilityRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.organization;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class UpdateProjectVisibilityWsRequest {
- private final String organization;
- private final String projectVisibility;
-
- private UpdateProjectVisibilityWsRequest(Builder builder) {
- this.organization = builder.organization;
- this.projectVisibility = builder.projectVisibility;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- @CheckForNull
- public String getProjectVisibility() {
- return projectVisibility;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String organization;
- private String projectVisibility;
-
- public Builder setOrganization(@Nullable String organization) {
- this.organization = organization;
- return this;
- }
-
- public Builder setProjectVisibility(@Nullable String projectVisibility) {
- this.projectVisibility = projectVisibility;
- return this;
- }
-
- public UpdateProjectVisibilityWsRequest build() {
- return new UpdateProjectVisibilityWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.organization;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+@Immutable
+public class UpdateRequest {
+ private final String key;
+ private final String name;
+ private final String description;
+ private final String url;
+ private final String avatar;
+
+ private UpdateRequest(Builder builder) {
+ this.name = builder.name;
+ this.key = builder.key;
+ this.description = builder.description;
+ this.url = builder.url;
+ this.avatar = builder.avatar;
+ }
+
+ @CheckForNull
+ public String getName() {
+ return name;
+ }
+
+ @CheckForNull
+ public String getKey() {
+ return key;
+ }
+
+ @CheckForNull
+ public String getDescription() {
+ return description;
+ }
+
+ @CheckForNull
+ public String getUrl() {
+ return url;
+ }
+
+ @CheckForNull
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public static class Builder {
+ private String key;
+ private String name;
+ private String description;
+ private String url;
+ private String avatar;
+
+ public Builder setKey(@Nullable String key) {
+ this.key = key;
+ return this;
+ }
+
+ public Builder setName(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder setDescription(@Nullable String description) {
+ this.description = description;
+ return this;
+ }
+
+ public Builder setUrl(@Nullable String url) {
+ this.url = url;
+ return this;
+ }
+
+ public Builder setAvatar(@Nullable String avatar) {
+ this.avatar = avatar;
+ return this;
+ }
+
+ public UpdateRequest build() {
+ return new UpdateRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.organization;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class UpdateWsRequest {
- private final String key;
- private final String name;
- private final String description;
- private final String url;
- private final String avatar;
-
- private UpdateWsRequest(Builder builder) {
- this.name = builder.name;
- this.key = builder.key;
- this.description = builder.description;
- this.url = builder.url;
- this.avatar = builder.avatar;
- }
-
- @CheckForNull
- public String getName() {
- return name;
- }
-
- @CheckForNull
- public String getKey() {
- return key;
- }
-
- @CheckForNull
- public String getDescription() {
- return description;
- }
-
- @CheckForNull
- public String getUrl() {
- return url;
- }
-
- @CheckForNull
- public String getAvatar() {
- return avatar;
- }
-
- public static class Builder {
- private String key;
- private String name;
- private String description;
- private String url;
- private String avatar;
-
- public Builder setKey(@Nullable String key) {
- this.key = key;
- return this;
- }
-
- public Builder setName(@Nullable String name) {
- this.name = name;
- return this;
- }
-
- public Builder setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public Builder setUrl(@Nullable String url) {
- this.url = url;
- return this;
- }
-
- public Builder setAvatar(@Nullable String avatar) {
- this.avatar = avatar;
- return this;
- }
-
- public UpdateWsRequest build() {
- return new UpdateWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class AddGroupRequest {
+ private String permission;
+ private String groupId;
+ private String organization;
+ private String groupName;
+ private String projectId;
+ private String projectKey;
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public AddGroupRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission, "permission must not be null");
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public AddGroupRequest setGroupId(@Nullable String groupId) {
+ this.groupId = groupId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public AddGroupRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public AddGroupRequest setGroupName(@Nullable String groupName) {
+ this.groupName = groupName;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public AddGroupRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public AddGroupRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class AddGroupToTemplateRequest {
+ private String groupId;
+ private String groupName;
+ private String permission;
+ private String templateId;
+ private String templateName;
+
+ @CheckForNull
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public AddGroupToTemplateRequest setGroupId(@Nullable String groupId) {
+ this.groupId = groupId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public AddGroupToTemplateRequest setGroupName(@Nullable String groupName) {
+ this.groupName = groupName;
+ return this;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public AddGroupToTemplateRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission, "permission must not be null");
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public AddGroupToTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public AddGroupToTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class AddGroupToTemplateWsRequest {
- private String groupId;
- private String groupName;
- private String permission;
- private String templateId;
- private String templateName;
-
- @CheckForNull
- public String getGroupId() {
- return groupId;
- }
-
- public AddGroupToTemplateWsRequest setGroupId(@Nullable String groupId) {
- this.groupId = groupId;
- return this;
- }
-
- @CheckForNull
- public String getGroupName() {
- return groupName;
- }
-
- public AddGroupToTemplateWsRequest setGroupName(@Nullable String groupName) {
- this.groupName = groupName;
- return this;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public AddGroupToTemplateWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission, "permission must not be null");
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public AddGroupToTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public AddGroupToTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class AddGroupWsRequest {
- private String permission;
- private String groupId;
- private String organization;
- private String groupName;
- private String projectId;
- private String projectKey;
-
- public String getPermission() {
- return permission;
- }
-
- public AddGroupWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission, "permission must not be null");
- return this;
- }
-
- @CheckForNull
- public String getGroupId() {
- return groupId;
- }
-
- public AddGroupWsRequest setGroupId(@Nullable String groupId) {
- this.groupId = groupId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public AddGroupWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getGroupName() {
- return groupName;
- }
-
- public AddGroupWsRequest setGroupName(@Nullable String groupName) {
- this.groupName = groupName;
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public AddGroupWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public AddGroupWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import static java.util.Objects.requireNonNull;
+
+@Immutable
+public class AddProjectCreatorToTemplateRequest {
+ private final String templateId;
+ private final String organization;
+ private final String templateName;
+ private final String permission;
+
+ private AddProjectCreatorToTemplateRequest(Builder builder) {
+ this.templateId = builder.templateId;
+ this.organization = builder.organization;
+ this.templateName = builder.templateName;
+ this.permission = requireNonNull(builder.permission);
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String templateId;
+ private String organization;
+ private String templateName;
+ private String permission;
+
+ private Builder() {
+ // enforce method constructor
+ }
+
+ public Builder setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ public Builder setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ public Builder setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+
+ public Builder setPermission(@Nullable String permission) {
+ this.permission = permission;
+ return this;
+ }
+
+ public AddProjectCreatorToTemplateRequest build() {
+ return new AddProjectCreatorToTemplateRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static java.util.Objects.requireNonNull;
-
-@Immutable
-public class AddProjectCreatorToTemplateWsRequest {
- private final String templateId;
- private final String organization;
- private final String templateName;
- private final String permission;
-
- private AddProjectCreatorToTemplateWsRequest(Builder builder) {
- this.templateId = builder.templateId;
- this.organization = builder.organization;
- this.templateName = builder.templateName;
- this.permission = requireNonNull(builder.permission);
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String templateId;
- private String organization;
- private String templateName;
- private String permission;
-
- private Builder() {
- // enforce method constructor
- }
-
- public Builder setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- public Builder setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- public Builder setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-
- public Builder setPermission(@Nullable String permission) {
- this.permission = permission;
- return this;
- }
-
- public AddProjectCreatorToTemplateWsRequest build() {
- return new AddProjectCreatorToTemplateWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class AddUserRequest {
+ private String login;
+ private String permission;
+ private String projectId;
+ private String projectKey;
+ private String organization;
+
+ public String getLogin() {
+ return login;
+ }
+
+ public AddUserRequest setLogin(String login) {
+ this.login = requireNonNull(login, "login must not be null");
+ return this;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public AddUserRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission, "permission must not be null");
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public AddUserRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public AddUserRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public AddUserRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class AddUserToTemplateRequest {
+ private String login;
+ private String permission;
+ private String templateId;
+ private String organization;
+ private String templateName;
+
+ public String getLogin() {
+ return login;
+ }
+
+ public AddUserToTemplateRequest setLogin(String login) {
+ this.login = requireNonNull(login);
+ return this;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public AddUserToTemplateRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission);
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public AddUserToTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public AddUserToTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public AddUserToTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class AddUserToTemplateWsRequest {
- private String login;
- private String permission;
- private String templateId;
- private String organization;
- private String templateName;
-
- public String getLogin() {
- return login;
- }
-
- public AddUserToTemplateWsRequest setLogin(String login) {
- this.login = requireNonNull(login);
- return this;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public AddUserToTemplateWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission);
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public AddUserToTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public AddUserToTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public AddUserToTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class AddUserWsRequest {
- private String login;
- private String permission;
- private String projectId;
- private String projectKey;
- private String organization;
-
- public String getLogin() {
- return login;
- }
-
- public AddUserWsRequest setLogin(String login) {
- this.login = requireNonNull(login, "login must not be null");
- return this;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public AddUserWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission, "permission must not be null");
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public AddUserWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public AddUserWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public AddUserWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class ApplyTemplateRequest {
+ private String projectId;
+ private String projectKey;
+ private String templateId;
+ private String organization;
+ private String templateName;
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public ApplyTemplateRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public ApplyTemplateRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public ApplyTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public ApplyTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public ApplyTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class ApplyTemplateWsRequest {
- private String projectId;
- private String projectKey;
- private String templateId;
- private String organization;
- private String templateName;
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public ApplyTemplateWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public ApplyTemplateWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public ApplyTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public ApplyTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public ApplyTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import java.util.Collection;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import org.sonar.api.resources.Qualifiers;
+
+import static java.util.Collections.singleton;
+import static java.util.Objects.requireNonNull;
+
+public class BulkApplyTemplateRequest {
+ private String templateId;
+ private String organization;
+ private String templateName;
+ private String query;
+ private Collection<String> qualifiers = singleton(Qualifiers.PROJECT);
+ private String visibility;
+ private String analyzedBefore;
+ private boolean onProvisionedOnly = false;
+ private Collection<String> projects;
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public BulkApplyTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public BulkApplyTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public BulkApplyTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public BulkApplyTemplateRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ public Collection<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ public BulkApplyTemplateRequest setQualifiers(Collection<String> qualifiers) {
+ this.qualifiers = requireNonNull(qualifiers);
+ return this;
+ }
+
+ @CheckForNull
+ public String getVisibility() {
+ return visibility;
+ }
+
+ public BulkApplyTemplateRequest setVisibility(@Nullable String visibility) {
+ this.visibility = visibility;
+ return this;
+ }
+
+ @CheckForNull
+ public String getAnalyzedBefore() {
+ return analyzedBefore;
+ }
+
+ public BulkApplyTemplateRequest setAnalyzedBefore(@Nullable String analyzedBefore) {
+ this.analyzedBefore = analyzedBefore;
+ return this;
+ }
+
+ public boolean isOnProvisionedOnly() {
+ return onProvisionedOnly;
+ }
+
+ public BulkApplyTemplateRequest setOnProvisionedOnly(boolean onProvisionedOnly) {
+ this.onProvisionedOnly = onProvisionedOnly;
+ return this;
+ }
+
+ @CheckForNull
+ public Collection<String> getProjects() {
+ return projects;
+ }
+
+ public BulkApplyTemplateRequest setProjects(@Nullable Collection<String> projects) {
+ this.projects = projects;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import java.util.Collection;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import org.sonar.api.resources.Qualifiers;
-
-import static java.util.Collections.singleton;
-import static java.util.Objects.requireNonNull;
-
-public class BulkApplyTemplateWsRequest {
- private String templateId;
- private String organization;
- private String templateName;
- private String query;
- private Collection<String> qualifiers = singleton(Qualifiers.PROJECT);
- private String visibility;
- private String analyzedBefore;
- private boolean onProvisionedOnly = false;
- private Collection<String> projects;
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public BulkApplyTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public BulkApplyTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public BulkApplyTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public BulkApplyTemplateWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- public Collection<String> getQualifiers() {
- return qualifiers;
- }
-
- public BulkApplyTemplateWsRequest setQualifiers(Collection<String> qualifiers) {
- this.qualifiers = requireNonNull(qualifiers);
- return this;
- }
-
- @CheckForNull
- public String getVisibility() {
- return visibility;
- }
-
- public BulkApplyTemplateWsRequest setVisibility(@Nullable String visibility) {
- this.visibility = visibility;
- return this;
- }
-
- @CheckForNull
- public String getAnalyzedBefore() {
- return analyzedBefore;
- }
-
- public BulkApplyTemplateWsRequest setAnalyzedBefore(@Nullable String analyzedBefore) {
- this.analyzedBefore = analyzedBefore;
- return this;
- }
-
- public boolean isOnProvisionedOnly() {
- return onProvisionedOnly;
- }
-
- public BulkApplyTemplateWsRequest setOnProvisionedOnly(boolean onProvisionedOnly) {
- this.onProvisionedOnly = onProvisionedOnly;
- return this;
- }
-
- @CheckForNull
- public Collection<String> getProjects() {
- return projects;
- }
-
- public BulkApplyTemplateWsRequest setProjects(@Nullable Collection<String> projects) {
- this.projects = projects;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class CreateTemplateRequest {
+ private String description;
+ private String name;
+ private String projectKeyPattern;
+ private String organization;
+
+ @CheckForNull
+ public String getDescription() {
+ return description;
+ }
+
+ public CreateTemplateRequest setDescription(@Nullable String description) {
+ this.description = description;
+ return this;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public CreateTemplateRequest setName(String name) {
+ this.name = requireNonNull(name);
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKeyPattern() {
+ return projectKeyPattern;
+ }
+
+ public CreateTemplateRequest setProjectKeyPattern(@Nullable String projectKeyPattern) {
+ this.projectKeyPattern = projectKeyPattern;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public CreateTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class CreateTemplateWsRequest {
- private String description;
- private String name;
- private String projectKeyPattern;
- private String organization;
-
- @CheckForNull
- public String getDescription() {
- return description;
- }
-
- public CreateTemplateWsRequest setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public String getName() {
- return name;
- }
-
- public CreateTemplateWsRequest setName(String name) {
- this.name = requireNonNull(name);
- return this;
- }
-
- @CheckForNull
- public String getProjectKeyPattern() {
- return projectKeyPattern;
- }
-
- public CreateTemplateWsRequest setProjectKeyPattern(@Nullable String projectKeyPattern) {
- this.projectKeyPattern = projectKeyPattern;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public CreateTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class DeleteTemplateRequest {
+ private String templateId;
+ private String organization;
+ private String templateName;
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public DeleteTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public DeleteTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public DeleteTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class DeleteTemplateWsRequest {
- private String templateId;
- private String organization;
- private String templateName;
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public DeleteTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public DeleteTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public DeleteTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class GroupsRequest {
+ private String permission;
+ private String projectId;
+ private String projectKey;
+ private Integer page;
+ private Integer pageSize;
+ private String query;
+
+ @CheckForNull
+ public String getPermission() {
+ return permission;
+ }
+
+ public GroupsRequest setPermission(@Nullable String permission) {
+ this.permission = permission;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public GroupsRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public GroupsRequest setProjectKey(String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public GroupsRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public GroupsRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public GroupsRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class GroupsWsRequest {
- private String permission;
- private String projectId;
- private String projectKey;
- private Integer page;
- private Integer pageSize;
- private String query;
-
- @CheckForNull
- public String getPermission() {
- return permission;
- }
-
- public GroupsWsRequest setPermission(@Nullable String permission) {
- this.permission = permission;
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public GroupsWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public GroupsWsRequest setProjectKey(String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public GroupsWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public GroupsWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public GroupsWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-}
super(wsConnector, PermissionsWsParameters.CONTROLLER);
}
- public Permissions.WsGroupsResponse groups(GroupsWsRequest request) {
+ public Permissions.WsGroupsResponse groups(GroupsRequest request) {
GetRequest get = new GetRequest(path("groups"))
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_PROJECT_ID, request.getProjectId())
return call(get, Permissions.WsGroupsResponse.parser());
}
- public void addGroup(AddGroupWsRequest request) {
+ public void addGroup(AddGroupRequest request) {
call(new PostRequest(path("add_group"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_GROUP_NAME, request.getGroupName()));
}
- public void addGroupToTemplate(AddGroupToTemplateWsRequest request) {
+ public void addGroupToTemplate(AddGroupToTemplateRequest request) {
call(new PostRequest(path("add_group_to_template"))
.setParam(PARAM_GROUP_ID, request.getGroupId())
.setParam(PARAM_GROUP_NAME, request.getGroupName())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void addUser(AddUserWsRequest request) {
+ public void addUser(AddUserRequest request) {
call(new PostRequest(path("add_user"))
.setParam(PARAM_USER_LOGIN, request.getLogin())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_ORGANIZATION, request.getOrganization()));
}
- public void addUserToTemplate(AddUserToTemplateWsRequest request) {
+ public void addUserToTemplate(AddUserToTemplateRequest request) {
call(new PostRequest(path("add_user_to_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest request) {
+ public void addProjectCreatorToTemplate(AddProjectCreatorToTemplateRequest request) {
call(new PostRequest(path("add_project_creator_to_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void applyTemplate(ApplyTemplateWsRequest request) {
+ public void applyTemplate(ApplyTemplateRequest request) {
call(new PostRequest(path("apply_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PROJECT_ID, request.getProjectId())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void bulkApplyTemplate(BulkApplyTemplateWsRequest request) {
+ public void bulkApplyTemplate(BulkApplyTemplateRequest request) {
call(new PostRequest(path("bulk_apply_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_TEMPLATE_ID, request.getTemplateId())
.setParam(ProjectsWsParameters.PARAM_PROJECTS, inlineMultipleParamValue(request.getProjects())));
}
- public CreateTemplateWsResponse createTemplate(CreateTemplateWsRequest request) {
+ public CreateTemplateWsResponse createTemplate(CreateTemplateRequest request) {
PostRequest post = new PostRequest(path("create_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_NAME, request.getName())
return call(post, CreateTemplateWsResponse.parser());
}
- public void deleteTemplate(DeleteTemplateWsRequest request) {
+ public void deleteTemplate(DeleteTemplateRequest request) {
call(new PostRequest(path("delete_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_TEMPLATE_ID, request.getTemplateId())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void removeGroup(RemoveGroupWsRequest request) {
+ public void removeGroup(RemoveGroupRequest request) {
call(new PostRequest(path("remove_group"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_PROJECT_KEY, request.getProjectKey()));
}
- public void removeGroupFromTemplate(RemoveGroupFromTemplateWsRequest request) {
+ public void removeGroupFromTemplate(RemoveGroupFromTemplateRequest request) {
call(new PostRequest(path("remove_group_from_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateWsRequest request) {
+ public void removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateRequest request) {
call(
new PostRequest(path("remove_project_creator_from_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public void removeUser(RemoveUserWsRequest request) {
+ public void removeUser(RemoveUserRequest request) {
call(new PostRequest(path("remove_user"))
.setParam(PARAM_PERMISSION, request.getPermission())
.setParam(PARAM_USER_LOGIN, request.getLogin())
.setParam(PARAM_PROJECT_KEY, request.getProjectKey()));
}
- public void removeUserFromTemplate(RemoveUserFromTemplateWsRequest request) {
+ public void removeUserFromTemplate(RemoveUserFromTemplateRequest request) {
call(new PostRequest(path("remove_user_from_template"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
return call(get, WsSearchGlobalPermissionsResponse.parser());
}
- public SearchProjectPermissionsWsResponse searchProjectPermissions(SearchProjectPermissionsWsRequest request) {
+ public SearchProjectPermissionsWsResponse searchProjectPermissions(SearchProjectPermissionsRequest request) {
GetRequest get = new GetRequest(path("search_project_permissions"))
.setParam(PARAM_PROJECT_ID, request.getProjectId())
.setParam(PARAM_PROJECT_KEY, request.getProjectKey())
return call(get, SearchProjectPermissionsWsResponse.parser());
}
- public SearchTemplatesWsResponse searchTemplates(SearchTemplatesWsRequest request) {
+ public SearchTemplatesWsResponse searchTemplates(SearchTemplatesRequest request) {
GetRequest get = new GetRequest(path("search_templates"))
.setParam("q", request.getQuery());
return call(get, SearchTemplatesWsResponse.parser());
}
- public void setDefaultTemplate(SetDefaultTemplateWsRequest request) {
+ public void setDefaultTemplate(SetDefaultTemplateRequest request) {
call(new PostRequest(path("set_default_template"))
.setParam(PARAM_QUALIFIER, request.getQualifier())
.setParam(PARAM_TEMPLATE_ID, request.getTemplateId())
.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
- public UpdateTemplateWsResponse updateTemplate(UpdateTemplateWsRequest request) {
+ public UpdateTemplateWsResponse updateTemplate(UpdateTemplateRequest request) {
return call(new PostRequest(path("update_template"))
.setParam(PARAM_DESCRIPTION, request.getDescription())
.setParam(PARAM_ID, request.getId())
.setParam(PARAM_PROJECT_KEY_PATTERN, request.getProjectKeyPattern()), UpdateTemplateWsResponse.parser());
}
- public UsersWsResponse users(UsersWsRequest request) {
+ public UsersWsResponse users(UsersRequest request) {
return call(new GetRequest(path("users"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_PERMISSION, request.getPermission())
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class RemoveGroupFromTemplateRequest {
+ private String organization;
+ private String permission;
+ private String groupId;
+ private String groupName;
+ private String templateId;
+ private String templateName;
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public RemoveGroupFromTemplateRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission);
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public RemoveGroupFromTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public RemoveGroupFromTemplateRequest setGroupId(@Nullable String groupId) {
+ this.groupId = groupId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public RemoveGroupFromTemplateRequest setGroupName(@Nullable String groupName) {
+ this.groupName = groupName;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public RemoveGroupFromTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public RemoveGroupFromTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RemoveGroupFromTemplateWsRequest {
- private String organization;
- private String permission;
- private String groupId;
- private String groupName;
- private String templateId;
- private String templateName;
-
- public String getPermission() {
- return permission;
- }
-
- public RemoveGroupFromTemplateWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission);
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public RemoveGroupFromTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getGroupId() {
- return groupId;
- }
-
- public RemoveGroupFromTemplateWsRequest setGroupId(@Nullable String groupId) {
- this.groupId = groupId;
- return this;
- }
-
- @CheckForNull
- public String getGroupName() {
- return groupName;
- }
-
- public RemoveGroupFromTemplateWsRequest setGroupName(@Nullable String groupName) {
- this.groupName = groupName;
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public RemoveGroupFromTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public RemoveGroupFromTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class RemoveGroupRequest {
+ private String organization;
+ private String groupId;
+ private String groupName;
+ private String permission;
+ private String projectId;
+ private String projectKey;
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public RemoveGroupRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public RemoveGroupRequest setGroupId(@Nullable String groupId) {
+ this.groupId = groupId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public RemoveGroupRequest setGroupName(@Nullable String groupName) {
+ this.groupName = groupName;
+ return this;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public RemoveGroupRequest setPermission(String permission) {
+ this.permission = permission;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public RemoveGroupRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public RemoveGroupRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class RemoveGroupWsRequest {
- private String organization;
- private String groupId;
- private String groupName;
- private String permission;
- private String projectId;
- private String projectKey;
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public RemoveGroupWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getGroupId() {
- return groupId;
- }
-
- public RemoveGroupWsRequest setGroupId(@Nullable String groupId) {
- this.groupId = groupId;
- return this;
- }
-
- @CheckForNull
- public String getGroupName() {
- return groupName;
- }
-
- public RemoveGroupWsRequest setGroupName(@Nullable String groupName) {
- this.groupName = groupName;
- return this;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public RemoveGroupWsRequest setPermission(String permission) {
- this.permission = permission;
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public RemoveGroupWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public RemoveGroupWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import static java.util.Objects.requireNonNull;
+
+@Immutable
+public class RemoveProjectCreatorFromTemplateRequest {
+ private final String templateId;
+ private final String organization;
+ private final String templateName;
+ private final String permission;
+
+ private RemoveProjectCreatorFromTemplateRequest(Builder builder) {
+ this.templateId = builder.templateId;
+ this.organization = builder.organization;
+ this.templateName = builder.templateName;
+ this.permission = requireNonNull(builder.permission);
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String templateId;
+ private String organization;
+ private String templateName;
+ private String permission;
+
+ private Builder() {
+ // enforce method constructor
+ }
+
+ public Builder setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ public Builder setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ public Builder setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+
+ public Builder setPermission(@Nullable String permission) {
+ this.permission = permission;
+ return this;
+ }
+
+ public RemoveProjectCreatorFromTemplateRequest build() {
+ return new RemoveProjectCreatorFromTemplateRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static java.util.Objects.requireNonNull;
-
-@Immutable
-public class RemoveProjectCreatorFromTemplateWsRequest {
- private final String templateId;
- private final String organization;
- private final String templateName;
- private final String permission;
-
- private RemoveProjectCreatorFromTemplateWsRequest(Builder builder) {
- this.templateId = builder.templateId;
- this.organization = builder.organization;
- this.templateName = builder.templateName;
- this.permission = requireNonNull(builder.permission);
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String templateId;
- private String organization;
- private String templateName;
- private String permission;
-
- private Builder() {
- // enforce method constructor
- }
-
- public Builder setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- public Builder setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- public Builder setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-
- public Builder setPermission(@Nullable String permission) {
- this.permission = permission;
- return this;
- }
-
- public RemoveProjectCreatorFromTemplateWsRequest build() {
- return new RemoveProjectCreatorFromTemplateWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class RemoveUserFromTemplateRequest {
+ private String login;
+ private String permission;
+ private String templateId;
+ private String organization;
+ private String templateName;
+
+ public String getLogin() {
+ return login;
+ }
+
+ public RemoveUserFromTemplateRequest setLogin(String login) {
+ this.login = requireNonNull(login);
+ return this;
+ }
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public RemoveUserFromTemplateRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission);
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public RemoveUserFromTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public RemoveUserFromTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public RemoveUserFromTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RemoveUserFromTemplateWsRequest {
- private String login;
- private String permission;
- private String templateId;
- private String organization;
- private String templateName;
-
- public String getLogin() {
- return login;
- }
-
- public RemoveUserFromTemplateWsRequest setLogin(String login) {
- this.login = requireNonNull(login);
- return this;
- }
-
- public String getPermission() {
- return permission;
- }
-
- public RemoveUserFromTemplateWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission);
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public RemoveUserFromTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public RemoveUserFromTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public RemoveUserFromTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class RemoveUserRequest {
+ private String permission;
+ private String login;
+ private String projectId;
+ private String projectKey;
+
+ public String getPermission() {
+ return permission;
+ }
+
+ public RemoveUserRequest setPermission(String permission) {
+ this.permission = requireNonNull(permission);
+ return this;
+ }
+
+ public String getLogin() {
+ return login;
+ }
+
+ public RemoveUserRequest setLogin(String login) {
+ this.login = requireNonNull(login);
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public RemoveUserRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public RemoveUserRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RemoveUserWsRequest {
- private String permission;
- private String login;
- private String projectId;
- private String projectKey;
-
- public String getPermission() {
- return permission;
- }
-
- public RemoveUserWsRequest setPermission(String permission) {
- this.permission = requireNonNull(permission);
- return this;
- }
-
- public String getLogin() {
- return login;
- }
-
- public RemoveUserWsRequest setLogin(String login) {
- this.login = requireNonNull(login);
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public RemoveUserWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public RemoveUserWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchProjectPermissionsRequest {
+ private String projectId;
+ private String projectKey;
+ private String qualifier;
+ private Integer page;
+ private Integer pageSize;
+ private String query;
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public SearchProjectPermissionsRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public SearchProjectPermissionsRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public SearchProjectPermissionsRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public SearchProjectPermissionsRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public SearchProjectPermissionsRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public SearchProjectPermissionsRequest setQualifier(@Nullable String qualifier) {
+ this.qualifier = qualifier;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchProjectPermissionsWsRequest {
- private String projectId;
- private String projectKey;
- private String qualifier;
- private Integer page;
- private Integer pageSize;
- private String query;
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public SearchProjectPermissionsWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public SearchProjectPermissionsWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public SearchProjectPermissionsWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public SearchProjectPermissionsWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public SearchProjectPermissionsWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public String getQualifier() {
- return qualifier;
- }
-
- public SearchProjectPermissionsWsRequest setQualifier(@Nullable String qualifier) {
- this.qualifier = qualifier;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchTemplatesRequest {
+ private String query;
+ private String organizationUuid;
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public SearchTemplatesRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ public String getOrganizationUuid() {
+ return organizationUuid;
+ }
+
+ public SearchTemplatesRequest setOrganizationUuid(String s) {
+ this.organizationUuid = s;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchTemplatesWsRequest {
- private String query;
- private String organizationUuid;
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public SearchTemplatesWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- public String getOrganizationUuid() {
- return organizationUuid;
- }
-
- public SearchTemplatesWsRequest setOrganizationUuid(String s) {
- this.organizationUuid = s;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SetDefaultTemplateRequest {
+ private String qualifier;
+ private String templateId;
+ private String organization;
+ private String templateName;
+
+ @CheckForNull
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public SetDefaultTemplateRequest setQualifier(@Nullable String qualifier) {
+ this.qualifier = qualifier;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateId() {
+ return templateId;
+ }
+
+ public SetDefaultTemplateRequest setTemplateId(@Nullable String templateId) {
+ this.templateId = templateId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public SetDefaultTemplateRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public SetDefaultTemplateRequest setTemplateName(@Nullable String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SetDefaultTemplateWsRequest {
- private String qualifier;
- private String templateId;
- private String organization;
- private String templateName;
-
- @CheckForNull
- public String getQualifier() {
- return qualifier;
- }
-
- public SetDefaultTemplateWsRequest setQualifier(@Nullable String qualifier) {
- this.qualifier = qualifier;
- return this;
- }
-
- @CheckForNull
- public String getTemplateId() {
- return templateId;
- }
-
- public SetDefaultTemplateWsRequest setTemplateId(@Nullable String templateId) {
- this.templateId = templateId;
- return this;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public SetDefaultTemplateWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getTemplateName() {
- return templateName;
- }
-
- public SetDefaultTemplateWsRequest setTemplateName(@Nullable String templateName) {
- this.templateName = templateName;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class UpdateTemplateRequest {
+ private String id;
+ private String description;
+ private String name;
+ private String projectKeyPattern;
+
+ public String getId() {
+ return id;
+ }
+
+ public UpdateTemplateRequest setId(String id) {
+ this.id = requireNonNull(id);
+ return this;
+ }
+
+ @CheckForNull
+ public String getDescription() {
+ return description;
+ }
+
+ public UpdateTemplateRequest setDescription(@Nullable String description) {
+ this.description = description;
+ return this;
+ }
+
+ @CheckForNull
+ public String getName() {
+ return name;
+ }
+
+ public UpdateTemplateRequest setName(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKeyPattern() {
+ return projectKeyPattern;
+ }
+
+ public UpdateTemplateRequest setProjectKeyPattern(@Nullable String projectKeyPattern) {
+ this.projectKeyPattern = projectKeyPattern;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class UpdateTemplateWsRequest {
- private String id;
- private String description;
- private String name;
- private String projectKeyPattern;
-
- public String getId() {
- return id;
- }
-
- public UpdateTemplateWsRequest setId(String id) {
- this.id = requireNonNull(id);
- return this;
- }
-
- @CheckForNull
- public String getDescription() {
- return description;
- }
-
- public UpdateTemplateWsRequest setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- @CheckForNull
- public String getName() {
- return name;
- }
-
- public UpdateTemplateWsRequest setName(@Nullable String name) {
- this.name = name;
- return this;
- }
-
- @CheckForNull
- public String getProjectKeyPattern() {
- return projectKeyPattern;
- }
-
- public UpdateTemplateWsRequest setProjectKeyPattern(@Nullable String projectKeyPattern) {
- this.projectKeyPattern = projectKeyPattern;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.permission;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class UsersRequest {
+ private String organization;
+ private String permission;
+ private String projectId;
+ private String projectKey;
+ private String query;
+ private Integer page;
+ private Integer pageSize;
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public UsersRequest setOrganization(@Nullable String s) {
+ this.organization = s;
+ return this;
+ }
+
+ @CheckForNull
+ public String getPermission() {
+ return permission;
+ }
+
+ public UsersRequest setPermission(@Nullable String permission) {
+ this.permission = permission;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public UsersRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public UsersRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ public UsersRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ public UsersRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public UsersRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.permission;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class UsersWsRequest {
- private String organization;
- private String permission;
- private String projectId;
- private String projectKey;
- private String query;
- private Integer page;
- private Integer pageSize;
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public UsersWsRequest setOrganization(@Nullable String s) {
- this.organization = s;
- return this;
- }
-
- @CheckForNull
- public String getPermission() {
- return permission;
- }
-
- public UsersWsRequest setPermission(@Nullable String permission) {
- this.permission = permission;
- return this;
- }
-
- @CheckForNull
- public String getProjectId() {
- return projectId;
- }
-
- public UsersWsRequest setProjectId(@Nullable String projectId) {
- this.projectId = projectId;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public UsersWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- public UsersWsRequest setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- public UsersWsRequest setPage(int page) {
- this.page = page;
- return this;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- public UsersWsRequest setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.project;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+@Immutable
+public class BulkUpdateKeyRequest {
+ private final String id;
+ private final String key;
+ private final String from;
+ private final String to;
+ private final boolean dryRun;
+
+ public BulkUpdateKeyRequest(Builder builder) {
+ this.id = builder.id;
+ this.key = builder.key;
+ this.from = builder.from;
+ this.to = builder.to;
+ this.dryRun = builder.dryRun;
+ }
+
+ @CheckForNull
+ public String getId() {
+ return id;
+ }
+
+ @CheckForNull
+ public String getKey() {
+ return key;
+ }
+
+ public String getFrom() {
+ return from;
+ }
+
+ public String getTo() {
+ return to;
+ }
+
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String id;
+ private String key;
+ private String from;
+ private String to;
+ private boolean dryRun;
+
+ private Builder() {
+ // enforce method constructor
+ }
+
+ public Builder setId(@Nullable String id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder setKey(@Nullable String key) {
+ this.key = key;
+ return this;
+ }
+
+ public Builder setFrom(String from) {
+ this.from = from;
+ return this;
+ }
+
+ public Builder setTo(String to) {
+ this.to = to;
+ return this;
+ }
+
+ public Builder setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ return this;
+ }
+
+ public BulkUpdateKeyRequest build() {
+ checkArgument(from != null && !from.isEmpty(), "The string to match must not be empty");
+ checkArgument(to != null && !to.isEmpty(), "The string replacement must not be empty");
+ return new BulkUpdateKeyRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.project;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-@Immutable
-public class BulkUpdateKeyWsRequest {
- private final String id;
- private final String key;
- private final String from;
- private final String to;
- private final boolean dryRun;
-
- public BulkUpdateKeyWsRequest(Builder builder) {
- this.id = builder.id;
- this.key = builder.key;
- this.from = builder.from;
- this.to = builder.to;
- this.dryRun = builder.dryRun;
- }
-
- @CheckForNull
- public String getId() {
- return id;
- }
-
- @CheckForNull
- public String getKey() {
- return key;
- }
-
- public String getFrom() {
- return from;
- }
-
- public String getTo() {
- return to;
- }
-
- public boolean isDryRun() {
- return dryRun;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String id;
- private String key;
- private String from;
- private String to;
- private boolean dryRun;
-
- private Builder() {
- // enforce method constructor
- }
-
- public Builder setId(@Nullable String id) {
- this.id = id;
- return this;
- }
-
- public Builder setKey(@Nullable String key) {
- this.key = key;
- return this;
- }
-
- public Builder setFrom(String from) {
- this.from = from;
- return this;
- }
-
- public Builder setTo(String to) {
- this.to = to;
- return this;
- }
-
- public Builder setDryRun(boolean dryRun) {
- this.dryRun = dryRun;
- return this;
- }
-
- public BulkUpdateKeyWsRequest build() {
- checkArgument(from != null && !from.isEmpty(), "The string to match must not be empty");
- checkArgument(to != null && !to.isEmpty(), "The string replacement must not be empty");
- return new BulkUpdateKeyWsRequest(this);
- }
- }
-}
.setParam("project", request.getKey()));
}
- public void bulkDelete(SearchWsRequest request) {
+ public void bulkDelete(SearchRequest request) {
PostRequest post = new PostRequest(path("bulk_delete"))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers()))
call(post);
}
- public void updateKey(UpdateKeyWsRequest request) {
+ public void updateKey(UpdateKeyRequest request) {
PostRequest post = new PostRequest(path(ACTION_UPDATE_KEY))
.setParam(PARAM_PROJECT_ID, request.getId())
.setParam(PARAM_FROM, request.getKey())
call(post);
}
- public BulkUpdateKeyWsResponse bulkUpdateKey(BulkUpdateKeyWsRequest request) {
+ public BulkUpdateKeyWsResponse bulkUpdateKey(BulkUpdateKeyRequest request) {
PostRequest post = new PostRequest(path(ACTION_BULK_UPDATE_KEY))
.setParam(PARAM_PROJECT_ID, request.getId())
.setParam(PARAM_PROJECT, request.getKey())
return call(post, BulkUpdateKeyWsResponse.parser());
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
GetRequest get = new GetRequest(path(ACTION_SEARCH))
.setParam(PARAM_ORGANIZATION, request.getOrganization())
.setParam(PARAM_QUALIFIERS, Joiner.on(",").join(request.getQualifiers()))
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.project;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import org.sonar.api.resources.Qualifiers;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Collections.singletonList;
+import static java.util.Objects.requireNonNull;
+import static org.sonarqube.ws.client.project.ProjectsWsParameters.MAX_PAGE_SIZE;
+
+public class SearchRequest {
+
+ private final String organization;
+ private final String query;
+ private final List<String> qualifiers;
+ private final String visibility;
+ private final Integer page;
+ private final Integer pageSize;
+ private final String analyzedBefore;
+ private final boolean onProvisionedOnly;
+ private final List<String> projects;
+ private final List<String> projectIds;
+
+ public SearchRequest(Builder builder) {
+ this.organization = builder.organization;
+ this.query = builder.query;
+ this.qualifiers = builder.qualifiers;
+ this.visibility = builder.visibility;
+ this.page = builder.page;
+ this.pageSize = builder.pageSize;
+ this.analyzedBefore = builder.analyzedBefore;
+ this.onProvisionedOnly = builder.onProvisionedOnly;
+ this.projects = builder.projects;
+ this.projectIds = builder.projectIds;
+ }
+
+ @CheckForNull
+ public String getOrganization() {
+ return organization;
+ }
+
+ public List<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ @CheckForNull
+ public Integer getPage() {
+ return page;
+ }
+
+ @CheckForNull
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ @CheckForNull
+ public String getQuery() {
+ return query;
+ }
+
+ @CheckForNull
+ public String getVisibility() {
+ return visibility;
+ }
+
+ @CheckForNull
+ public String getAnalyzedBefore() {
+ return analyzedBefore;
+ }
+
+ public boolean isOnProvisionedOnly() {
+ return onProvisionedOnly;
+ }
+
+ @CheckForNull
+ public List<String> getProjects() {
+ return projects;
+ }
+
+ @CheckForNull
+ public List<String> getProjectIds() {
+ return projectIds;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String organization;
+ private List<String> qualifiers = singletonList(Qualifiers.PROJECT);
+ private Integer page;
+ private Integer pageSize;
+ private String query;
+ private String visibility;
+ private String analyzedBefore;
+ private boolean onProvisionedOnly = false;
+ private List<String> projects;
+ private List<String> projectIds;
+
+ public Builder setOrganization(@Nullable String organization) {
+ this.organization = organization;
+ return this;
+ }
+
+ public Builder setQualifiers(List<String> qualifiers) {
+ this.qualifiers = requireNonNull(qualifiers, "Qualifiers cannot be null");
+ return this;
+ }
+
+ public Builder setPage(@Nullable Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ public Builder setPageSize(@Nullable Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ public Builder setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ public Builder setVisibility(@Nullable String visibility) {
+ this.visibility = visibility;
+ return this;
+ }
+
+ public Builder setAnalyzedBefore(@Nullable String lastAnalysisBefore) {
+ this.analyzedBefore = lastAnalysisBefore;
+ return this;
+ }
+
+ public Builder setOnProvisionedOnly(boolean onProvisionedOnly) {
+ this.onProvisionedOnly = onProvisionedOnly;
+ return this;
+ }
+
+ public Builder setProjects(@Nullable List<String> projects) {
+ this.projects = projects;
+ return this;
+ }
+
+ public Builder setProjectIds(@Nullable List<String> projectIds) {
+ this.projectIds = projectIds;
+ return this;
+ }
+
+ public SearchRequest build() {
+ checkArgument(projects==null || !projects.isEmpty(), "Project key list must not be empty");
+ checkArgument(projectIds==null || !projectIds.isEmpty(), "Project id list must not be empty");
+ checkArgument(pageSize == null || pageSize <= MAX_PAGE_SIZE, "Page size must not be greater than %s", MAX_PAGE_SIZE);
+ return new SearchRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.project;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import org.sonar.api.resources.Qualifiers;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static java.util.Collections.singletonList;
-import static java.util.Objects.requireNonNull;
-import static org.sonarqube.ws.client.project.ProjectsWsParameters.MAX_PAGE_SIZE;
-
-public class SearchWsRequest {
-
- private final String organization;
- private final String query;
- private final List<String> qualifiers;
- private final String visibility;
- private final Integer page;
- private final Integer pageSize;
- private final String analyzedBefore;
- private final boolean onProvisionedOnly;
- private final List<String> projects;
- private final List<String> projectIds;
-
- public SearchWsRequest(Builder builder) {
- this.organization = builder.organization;
- this.query = builder.query;
- this.qualifiers = builder.qualifiers;
- this.visibility = builder.visibility;
- this.page = builder.page;
- this.pageSize = builder.pageSize;
- this.analyzedBefore = builder.analyzedBefore;
- this.onProvisionedOnly = builder.onProvisionedOnly;
- this.projects = builder.projects;
- this.projectIds = builder.projectIds;
- }
-
- @CheckForNull
- public String getOrganization() {
- return organization;
- }
-
- public List<String> getQualifiers() {
- return qualifiers;
- }
-
- @CheckForNull
- public Integer getPage() {
- return page;
- }
-
- @CheckForNull
- public Integer getPageSize() {
- return pageSize;
- }
-
- @CheckForNull
- public String getQuery() {
- return query;
- }
-
- @CheckForNull
- public String getVisibility() {
- return visibility;
- }
-
- @CheckForNull
- public String getAnalyzedBefore() {
- return analyzedBefore;
- }
-
- public boolean isOnProvisionedOnly() {
- return onProvisionedOnly;
- }
-
- @CheckForNull
- public List<String> getProjects() {
- return projects;
- }
-
- @CheckForNull
- public List<String> getProjectIds() {
- return projectIds;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String organization;
- private List<String> qualifiers = singletonList(Qualifiers.PROJECT);
- private Integer page;
- private Integer pageSize;
- private String query;
- private String visibility;
- private String analyzedBefore;
- private boolean onProvisionedOnly = false;
- private List<String> projects;
- private List<String> projectIds;
-
- public Builder setOrganization(@Nullable String organization) {
- this.organization = organization;
- return this;
- }
-
- public Builder setQualifiers(List<String> qualifiers) {
- this.qualifiers = requireNonNull(qualifiers, "Qualifiers cannot be null");
- return this;
- }
-
- public Builder setPage(@Nullable Integer page) {
- this.page = page;
- return this;
- }
-
- public Builder setPageSize(@Nullable Integer pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- public Builder setQuery(@Nullable String query) {
- this.query = query;
- return this;
- }
-
- public Builder setVisibility(@Nullable String visibility) {
- this.visibility = visibility;
- return this;
- }
-
- public Builder setAnalyzedBefore(@Nullable String lastAnalysisBefore) {
- this.analyzedBefore = lastAnalysisBefore;
- return this;
- }
-
- public Builder setOnProvisionedOnly(boolean onProvisionedOnly) {
- this.onProvisionedOnly = onProvisionedOnly;
- return this;
- }
-
- public Builder setProjects(@Nullable List<String> projects) {
- this.projects = projects;
- return this;
- }
-
- public Builder setProjectIds(@Nullable List<String> projectIds) {
- this.projectIds = projectIds;
- return this;
- }
-
- public SearchWsRequest build() {
- checkArgument(projects==null || !projects.isEmpty(), "Project key list must not be empty");
- checkArgument(projectIds==null || !projectIds.isEmpty(), "Project id list must not be empty");
- checkArgument(pageSize == null || pageSize <= MAX_PAGE_SIZE, "Page size must not be greater than %s", MAX_PAGE_SIZE);
- return new SearchWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.project;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+@Immutable
+public class UpdateKeyRequest {
+ private final String id;
+ private final String key;
+ private final String newKey;
+
+ public UpdateKeyRequest(Builder builder) {
+ this.id = builder.id;
+ this.key = builder.key;
+ this.newKey = builder.newKey;
+ }
+
+ @CheckForNull
+ public String getId() {
+ return id;
+ }
+
+ @CheckForNull
+ public String getKey() {
+ return key;
+ }
+
+ public String getNewKey() {
+ return newKey;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String id;
+ private String key;
+ private String newKey;
+
+ private Builder() {
+ // enforce method constructor
+ }
+
+ public Builder setId(@Nullable String id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder setKey(@Nullable String key) {
+ this.key = key;
+ return this;
+ }
+
+ public Builder setNewKey(String newKey) {
+ this.newKey = newKey;
+ return this;
+ }
+
+ public UpdateKeyRequest build() {
+ checkArgument(newKey != null && !newKey.isEmpty(), "The new key must not be empty");
+ return new UpdateKeyRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.project;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-@Immutable
-public class UpdateKeyWsRequest {
- private final String id;
- private final String key;
- private final String newKey;
-
- public UpdateKeyWsRequest(Builder builder) {
- this.id = builder.id;
- this.key = builder.key;
- this.newKey = builder.newKey;
- }
-
- @CheckForNull
- public String getId() {
- return id;
- }
-
- @CheckForNull
- public String getKey() {
- return key;
- }
-
- public String getNewKey() {
- return newKey;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String id;
- private String key;
- private String newKey;
-
- private Builder() {
- // enforce method constructor
- }
-
- public Builder setId(@Nullable String id) {
- this.id = id;
- return this;
- }
-
- public Builder setKey(@Nullable String key) {
- this.key = key;
- return this;
- }
-
- public Builder setNewKey(String newKey) {
- this.newKey = newKey;
- return this;
- }
-
- public UpdateKeyWsRequest build() {
- checkArgument(newKey != null && !newKey.isEmpty(), "The new key must not be empty");
- return new UpdateKeyWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.qualityprofile;
+
+import java.util.Optional;
+import javax.annotation.Nullable;
+import org.sonarqube.ws.Common.Severity;
+
+import static java.util.Objects.requireNonNull;
+
+public class ActivateRuleRequest {
+ private final Optional<String> params;
+ private final String key;
+ private final Optional<Boolean> reset;
+ private final String ruleKey;
+ private final Optional<Severity> severity;
+ private final Optional<String> organization;
+
+ private ActivateRuleRequest(Builder builder) {
+ organization = requireNonNull(builder.organization);
+ params = requireNonNull(builder.params);
+ key = requireNonNull(builder.key);
+ reset = requireNonNull(builder.reset);
+ ruleKey = requireNonNull(builder.ruleKey);
+ severity = requireNonNull(builder.severity);
+ }
+
+ public static ActivateRuleRequest.Builder builder() {
+ return new Builder();
+ }
+
+ public Optional<String> getParams() {
+ return params;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public Optional<Boolean> getReset() {
+ return reset;
+ }
+
+ public String getRuleKey() {
+ return ruleKey;
+ }
+
+ public Optional<Severity> getSeverity() {
+ return severity;
+ }
+
+ public Optional<String> getOrganization() {
+ return organization;
+ }
+
+ public static class Builder {
+ private Optional<String> organization = Optional.empty();
+ private Optional<String> params = Optional.empty();
+ private String key;
+ private Optional<Boolean> reset = Optional.empty();
+ private String ruleKey;
+ private Optional<Severity> severity = Optional.empty();
+
+ private Builder() {
+ }
+
+ public Builder setOrganization(@Nullable String organization) {
+ this.organization = Optional.ofNullable(organization);
+ return this;
+ }
+
+ public Builder setParams(@Nullable String params) {
+ this.params = Optional.ofNullable(params);
+ return this;
+ }
+
+ public Builder setKey(String key) {
+ this.key = key;
+ return this;
+ }
+
+ public Builder setReset(@Nullable Boolean reset) {
+ this.reset = Optional.ofNullable(reset);
+ return this;
+ }
+
+ public Builder setRuleKey(String ruleKey) {
+ this.ruleKey = ruleKey;
+ return this;
+ }
+
+ public Builder setSeverity(@Nullable Severity severity) {
+ this.severity = Optional.ofNullable(severity);
+ return this;
+ }
+
+ public ActivateRuleRequest build() {
+ return new ActivateRuleRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualityprofile;
-
-import java.util.Optional;
-import javax.annotation.Nullable;
-import org.sonarqube.ws.Common.Severity;
-
-import static java.util.Objects.requireNonNull;
-
-public class ActivateRuleWsRequest {
- private final Optional<String> params;
- private final String key;
- private final Optional<Boolean> reset;
- private final String ruleKey;
- private final Optional<Severity> severity;
- private final Optional<String> organization;
-
- private ActivateRuleWsRequest(Builder builder) {
- organization = requireNonNull(builder.organization);
- params = requireNonNull(builder.params);
- key = requireNonNull(builder.key);
- reset = requireNonNull(builder.reset);
- ruleKey = requireNonNull(builder.ruleKey);
- severity = requireNonNull(builder.severity);
- }
-
- public static ActivateRuleWsRequest.Builder builder() {
- return new Builder();
- }
-
- public Optional<String> getParams() {
- return params;
- }
-
- public String getKey() {
- return key;
- }
-
- public Optional<Boolean> getReset() {
- return reset;
- }
-
- public String getRuleKey() {
- return ruleKey;
- }
-
- public Optional<Severity> getSeverity() {
- return severity;
- }
-
- public Optional<String> getOrganization() {
- return organization;
- }
-
- public static class Builder {
- private Optional<String> organization = Optional.empty();
- private Optional<String> params = Optional.empty();
- private String key;
- private Optional<Boolean> reset = Optional.empty();
- private String ruleKey;
- private Optional<Severity> severity = Optional.empty();
-
- private Builder() {
- }
-
- public Builder setOrganization(@Nullable String organization) {
- this.organization = Optional.ofNullable(organization);
- return this;
- }
-
- public Builder setParams(@Nullable String params) {
- this.params = Optional.ofNullable(params);
- return this;
- }
-
- public Builder setKey(String key) {
- this.key = key;
- return this;
- }
-
- public Builder setReset(@Nullable Boolean reset) {
- this.reset = Optional.ofNullable(reset);
- return this;
- }
-
- public Builder setRuleKey(String ruleKey) {
- this.ruleKey = ruleKey;
- return this;
- }
-
- public Builder setSeverity(@Nullable Severity severity) {
- this.severity = Optional.ofNullable(severity);
- return this;
- }
-
- public ActivateRuleWsRequest build() {
- return new ActivateRuleWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.qualityprofile;
+
+public class ChangelogRequest {
+
+ private final String language;
+ private final String organization;
+ private final Integer p;
+ private final Integer ps;
+ private final String qualityProfile;
+ private final String since;
+ private final String to;
+
+ private ChangelogRequest(Builder builder) {
+ this.language = builder.language;
+ this.organization = builder.organization;
+ this.p = builder.p;
+ this.ps = builder.ps;
+ this.qualityProfile = builder.qualityProfile;
+ this.since = builder.since;
+ this.to = builder.to;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public String getOrganization() {
+ return organization;
+ }
+
+ public Integer getP() {
+ return p;
+ }
+
+ public Integer getPs() {
+ return ps;
+ }
+
+ public String getQualityProfile() {
+ return qualityProfile;
+ }
+
+ public String getSince() {
+ return since;
+ }
+
+ public String getTo() {
+ return to;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String language;
+ private String organization;
+ private Integer p;
+ private Integer ps;
+ private String qualityProfile;
+ private String since;
+ private String to;
+
+ private Builder() {
+ }
+
+ public Builder setLanguage(String language) {
+ this.language = language;
+ return this;
+ }
+
+ public Builder setOrganization(String organization) {
+ this.organization = organization;
+ return this;
+ }
+
+ public Builder setP(Integer p) {
+ this.p = p;
+ return this;
+ }
+
+ public Builder setPs(Integer ps) {
+ this.ps = ps;
+ return this;
+ }
+
+ public Builder setQualityProfile(String qualityProfile) {
+ this.qualityProfile = qualityProfile;
+ return this;
+ }
+
+ public Builder setSince(String since) {
+ this.since = since;
+ return this;
+ }
+
+ public Builder setTo(String to) {
+ this.to = to;
+ return this;
+ }
+
+ public ChangelogRequest build() {
+ return new ChangelogRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualityprofile;
-
-public class ChangelogWsRequest {
-
- private final String language;
- private final String organization;
- private final Integer p;
- private final Integer ps;
- private final String qualityProfile;
- private final String since;
- private final String to;
-
- private ChangelogWsRequest(Builder builder) {
- this.language = builder.language;
- this.organization = builder.organization;
- this.p = builder.p;
- this.ps = builder.ps;
- this.qualityProfile = builder.qualityProfile;
- this.since = builder.since;
- this.to = builder.to;
- }
-
- public String getLanguage() {
- return language;
- }
-
- public String getOrganization() {
- return organization;
- }
-
- public Integer getP() {
- return p;
- }
-
- public Integer getPs() {
- return ps;
- }
-
- public String getQualityProfile() {
- return qualityProfile;
- }
-
- public String getSince() {
- return since;
- }
-
- public String getTo() {
- return to;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String language;
- private String organization;
- private Integer p;
- private Integer ps;
- private String qualityProfile;
- private String since;
- private String to;
-
- private Builder() {
- }
-
- public Builder setLanguage(String language) {
- this.language = language;
- return this;
- }
-
- public Builder setOrganization(String organization) {
- this.organization = organization;
- return this;
- }
-
- public Builder setP(Integer p) {
- this.p = p;
- return this;
- }
-
- public Builder setPs(Integer ps) {
- this.ps = ps;
- return this;
- }
-
- public Builder setQualityProfile(String qualityProfile) {
- this.qualityProfile = qualityProfile;
- return this;
- }
-
- public Builder setSince(String since) {
- this.since = since;
- return this;
- }
-
- public Builder setTo(String to) {
- this.to = to;
- return this;
- }
-
- public ChangelogWsRequest build() {
- return new ChangelogWsRequest(this);
- }
- }
-}
super(wsConnector, CONTROLLER_QUALITY_PROFILES);
}
- public void activateRule(ActivateRuleWsRequest request) {
+ public void activateRule(ActivateRuleRequest request) {
PostRequest httpRequest = new PostRequest(path(ACTION_ACTIVATE_RULE));
httpRequest.setParam(PARAM_ORGANIZATION, request.getOrganization().orElse(null));
httpRequest.setParam(PARAM_PARAMS, request.getParams().orElse(null));
call(httpRequest);
}
- public void restoreProfile(RestoreWsRequest request) {
+ public void restoreProfile(RestoreRequest request) {
PostRequest httpRequest = new PostRequest(path(ACTION_RESTORE));
httpRequest.setParam(PARAM_ORGANIZATION, request.getOrganization().orElse(null));
httpRequest.setPart(PARAM_BACKUP, new PostRequest.Part(MediaTypes.XML, request.getBackup()));
call(httpRequest);
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
return call(
new GetRequest(path(ACTION_SEARCH))
.setParam(PARAM_DEFAULTS, request.getDefaults())
SearchGroupsResponse.parser());
}
- public String changelog(ChangelogWsRequest request) {
+ public String changelog(ChangelogRequest request) {
PostRequest postRequest = new PostRequest(path("changelog"))
.setParam("language", request.getLanguage())
.setParam("organization", request.getOrganization())
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.qualityprofile;
+
+import java.io.File;
+import java.util.Optional;
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class RestoreRequest {
+
+ private final File backup;
+ private final Optional<String> organization;
+
+ private RestoreRequest(Builder builder) {
+ backup = requireNonNull(builder.backup);
+ organization = requireNonNull(builder.organization);
+ }
+
+ public File getBackup() {
+ return backup;
+ }
+
+ public Optional<String> getOrganization() {
+ return organization;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private File backup;
+ private Optional<String> organization = Optional.empty();
+
+ public Builder setBackup(File backup) {
+ this.backup = backup;
+ return this;
+ }
+
+ public Builder setOrganization(@Nullable String organization) {
+ this.organization = Optional.ofNullable(organization);
+ return this;
+ }
+
+ public RestoreRequest build() {
+ return new RestoreRequest(this);
+ }
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualityprofile;
-
-import java.io.File;
-import java.util.Optional;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RestoreWsRequest {
-
- private final File backup;
- private final Optional<String> organization;
-
- private RestoreWsRequest(Builder builder) {
- backup = requireNonNull(builder.backup);
- organization = requireNonNull(builder.organization);
- }
-
- public File getBackup() {
- return backup;
- }
-
- public Optional<String> getOrganization() {
- return organization;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private File backup;
- private Optional<String> organization = Optional.empty();
-
- public Builder setBackup(File backup) {
- this.backup = backup;
- return this;
- }
-
- public Builder setOrganization(@Nullable String organization) {
- this.organization = Optional.ofNullable(organization);
- return this;
- }
-
- public RestoreWsRequest build() {
- return new RestoreWsRequest(this);
- }
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.qualityprofile;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchRequest {
+ private String organizationKey;
+ private boolean defaults;
+ private String language;
+ private String qualityProfile;
+ private String projectKey;
+
+ public String getOrganizationKey() {
+ return organizationKey;
+ }
+
+ public SearchRequest setOrganizationKey(String organizationKey) {
+ this.organizationKey = organizationKey;
+ return this;
+ }
+
+ public boolean getDefaults() {
+ return defaults;
+ }
+
+ public SearchRequest setDefaults(boolean defaults) {
+ this.defaults = defaults;
+ return this;
+ }
+
+ @CheckForNull
+ public String getLanguage() {
+ return language;
+ }
+
+ public SearchRequest setLanguage(@Nullable String language) {
+ this.language = language;
+ return this;
+ }
+
+ @CheckForNull
+ public String getQualityProfile() {
+ return qualityProfile;
+ }
+
+ public SearchRequest setQualityProfile(@Nullable String qualityProfile) {
+ this.qualityProfile = qualityProfile;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public SearchRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchWsRequest {
- private String organizationKey;
- private boolean defaults;
- private String language;
- private String qualityProfile;
- private String projectKey;
-
- public String getOrganizationKey() {
- return organizationKey;
- }
-
- public SearchWsRequest setOrganizationKey(String organizationKey) {
- this.organizationKey = organizationKey;
- return this;
- }
-
- public boolean getDefaults() {
- return defaults;
- }
-
- public SearchWsRequest setDefaults(boolean defaults) {
- this.defaults = defaults;
- return this;
- }
-
- @CheckForNull
- public String getLanguage() {
- return language;
- }
-
- public SearchWsRequest setLanguage(@Nullable String language) {
- this.language = language;
- return this;
- }
-
- @CheckForNull
- public String getQualityProfile() {
- return qualityProfile;
- }
-
- public SearchWsRequest setQualityProfile(@Nullable String qualityProfile) {
- this.qualityProfile = qualityProfile;
- return this;
- }
-
- @CheckForNull
- public String getProjectKey() {
- return projectKey;
- }
-
- public SearchWsRequest setProjectKey(@Nullable String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-}
public void show() {
String key = randomAlphanumeric(20);
String id = randomAlphanumeric(20);
- underTest.show(new ShowWsRequest()
+ underTest.show(new ShowRequest()
.setKey(key)
.setId(id)
.setBranch("my_branch"));
@Test
public void suggestions() {
- SuggestionsWsRequest.More more = SuggestionsWsRequest.More.BRC;
+ SuggestionsRequest.More more = SuggestionsRequest.More.BRC;
String s = randomAlphanumeric(20);
- underTest.suggestions(SuggestionsWsRequest.builder()
+ underTest.suggestions(SuggestionsRequest.builder()
.setMore(more)
.setS(s)
.setRecentlyBrowsed(asList("key-1", "key-2"))
int page = 17;
int pageSize = 39;
String textQuery = randomAlphanumeric(20);
- underTest.search(new SearchWsRequest()
+ underTest.search(new SearchRequest()
.setOrganization(organization)
.setQualifiers(asList("q1", "q2"))
.setPage(page)
int page = 17;
int pageSize = 39;
String query = randomAlphanumeric(20);
- underTest.tree(new TreeWsRequest()
+ underTest.tree(new TreeRequest()
.setBaseComponentId(componentId)
.setBaseComponentKey(componentKey)
.setComponent(componentKey)
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.collect.ImmutableList;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SearchRequestTest {
+ private static final ImmutableList<String> LIST_OF_STRINGS = ImmutableList.of("A", "B");
+ private static final String SOME_STRING = "some string";
+ public static final int SOME_INT = 894352;
+
+ private SearchRequest underTest = new SearchRequest();
+
+ @Test
+ public void getActionPlans_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getActionPlans()).isNull();
+ }
+
+ @Test
+ public void setActionPlans_accepts_null() {
+ underTest.setActionPlans(null);
+ }
+
+ @Test
+ public void getActionPlans_returns_object_from_setActionPlans() {
+ underTest.setActionPlans(LIST_OF_STRINGS);
+
+ assertThat(underTest.getActionPlans()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getAdditionalFields_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getAdditionalFields()).isNull();
+ }
+
+ @Test
+ public void setAdditionalFields_accepts_null() {
+ underTest.setAdditionalFields(null);
+ }
+
+ @Test
+ public void getAdditionalFields_returns_object_from_setAdditionalFields() {
+ underTest.setAdditionalFields(LIST_OF_STRINGS);
+ assertThat(underTest.getAdditionalFields()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getAssignees_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getAssignees()).isNull();
+ }
+
+ @Test
+ public void setAssignees_accepts_null() {
+ underTest.setAssignees(null);
+ }
+
+ @Test
+ public void getAssignees_returns_object_from_setAssignees() {
+ underTest.setAssignees(LIST_OF_STRINGS);
+ assertThat(underTest.getAssignees()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getAuthors_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getAuthors()).isNull();
+ }
+
+ @Test
+ public void setAuthors_accepts_null() {
+ underTest.setAuthors(null);
+ }
+
+ @Test
+ public void getAuthors_returns_object_from_setAuthors() {
+ underTest.setAuthors(LIST_OF_STRINGS);
+ assertThat(underTest.getAuthors()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getComponentKeys_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getComponentKeys()).isNull();
+ }
+
+ @Test
+ public void setComponentKeys_accepts_null() {
+ underTest.setComponentKeys(null);
+ }
+
+ @Test
+ public void getComponentKeys_returns_object_from_setComponentKeys() {
+ underTest.setComponentKeys(LIST_OF_STRINGS);
+ assertThat(underTest.getComponentKeys()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getComponentRootUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getComponentRootUuids()).isNull();
+ }
+
+ @Test
+ public void setComponentRootUuids_accepts_null() {
+ underTest.setComponentRootUuids(null);
+ }
+
+ @Test
+ public void getComponentRootUuids_returns_object_from_setComponentRootUuids() {
+ underTest.setComponentRootUuids(LIST_OF_STRINGS);
+ assertThat(underTest.getComponentRootUuids()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getComponentRoots_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getComponentRoots()).isNull();
+ }
+
+ @Test
+ public void setComponentRoots_accepts_null() {
+ underTest.setComponentRoots(null);
+ }
+
+ @Test
+ public void getComponentRoots_returns_object_from_setComponentRoots() {
+ underTest.setComponentRoots(LIST_OF_STRINGS);
+ assertThat(underTest.getComponentRoots()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getComponentUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getComponentUuids()).isNull();
+ }
+
+ @Test
+ public void setComponentUuids_accepts_null() {
+ underTest.setComponentUuids(null);
+ }
+
+ @Test
+ public void getComponentUuids_returns_object_from_setComponentUuids() {
+ underTest.setComponentUuids(LIST_OF_STRINGS);
+ assertThat(underTest.getComponentUuids()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getComponents_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getComponents()).isNull();
+ }
+
+ @Test
+ public void setComponents_accepts_null() {
+ underTest.setComponents(null);
+ }
+
+ @Test
+ public void getComponents_returns_object_from_setComponents() {
+ underTest.setComponents(LIST_OF_STRINGS);
+ assertThat(underTest.getComponents()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getDirectories_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getDirectories()).isNull();
+ }
+
+ @Test
+ public void setDirectories_accepts_null() {
+ underTest.setDirectories(null);
+ }
+
+ @Test
+ public void getDirectories_returns_object_from_setDirectories() {
+ underTest.setDirectories(LIST_OF_STRINGS);
+ assertThat(underTest.getDirectories()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getFacets_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getFacets()).isNull();
+ }
+
+ @Test
+ public void setFacets_accepts_null() {
+ underTest.setFacets(null);
+ }
+
+ @Test
+ public void getFacets_returns_object_from_setFacets() {
+ underTest.setFacets(LIST_OF_STRINGS);
+ assertThat(underTest.getFacets()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getFileUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getFileUuids()).isNull();
+ }
+
+ @Test
+ public void setFileUuids_accepts_null() {
+ underTest.setFileUuids(null);
+ }
+
+ @Test
+ public void getFileUuids_returns_object_from_setFileUuids() {
+ underTest.setFileUuids(LIST_OF_STRINGS);
+ assertThat(underTest.getFileUuids()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getIssues_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getIssues()).isNull();
+ }
+
+ @Test
+ public void setIssues_accepts_null() {
+ underTest.setIssues(null);
+ }
+
+ @Test
+ public void getIssues_returns_object_from_setIssues() {
+ underTest.setIssues(LIST_OF_STRINGS);
+ assertThat(underTest.getIssues()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getLanguages_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getLanguages()).isNull();
+ }
+
+ @Test
+ public void setLanguages_accepts_null() {
+ underTest.setLanguages(null);
+ }
+
+ @Test
+ public void getLanguages_returns_object_from_setLanguages() {
+ underTest.setLanguages(LIST_OF_STRINGS);
+ assertThat(underTest.getLanguages()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getModuleUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getModuleUuids()).isNull();
+ }
+
+ @Test
+ public void setModuleUuids_accepts_null() {
+ underTest.setModuleUuids(null);
+ }
+
+ @Test
+ public void getModuleUuids_returns_object_from_setModuleUuids() {
+ underTest.setModuleUuids(LIST_OF_STRINGS);
+ assertThat(underTest.getModuleUuids()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getProjectKeys_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getProjectKeys()).isNull();
+ }
+
+ @Test
+ public void setProjectKeys_accepts_null() {
+ underTest.setProjectKeys(null);
+ }
+
+ @Test
+ public void getProjectKeys_returns_object_from_setProjectKeys() {
+ underTest.setProjectKeys(LIST_OF_STRINGS);
+ assertThat(underTest.getProjectKeys()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getProjectUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getProjectUuids()).isNull();
+ }
+
+ @Test
+ public void setProjectUuids_accepts_null() {
+ underTest.setProjectUuids(null);
+ }
+
+ @Test
+ public void getProjectUuids_returns_object_from_setProjectUuids() {
+ underTest.setProjectUuids(LIST_OF_STRINGS);
+ assertThat(underTest.getProjectUuids()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getProjects_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getProjects()).isNull();
+ }
+
+ @Test
+ public void setProjects_accepts_null() {
+ underTest.setProjects(null);
+ }
+
+ @Test
+ public void getProjects_returns_object_from_setProjects() {
+ underTest.setProjects(LIST_OF_STRINGS);
+ assertThat(underTest.getProjects()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getResolutions_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getResolutions()).isNull();
+ }
+
+ @Test
+ public void setResolutions_accepts_null() {
+ underTest.setResolutions(null);
+ }
+
+ @Test
+ public void getResolutions_returns_object_from_setResolutions() {
+ underTest.setResolutions(LIST_OF_STRINGS);
+ assertThat(underTest.getResolutions()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getRules_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getRules()).isNull();
+ }
+
+ @Test
+ public void setRules_accepts_null() {
+ underTest.setRules(null);
+ }
+
+ @Test
+ public void getRules_returns_object_from_setRules() {
+ underTest.setRules(LIST_OF_STRINGS);
+ assertThat(underTest.getRules()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getSeverities_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getSeverities()).isNull();
+ }
+
+ @Test
+ public void setSeverities_accepts_null() {
+ underTest.setSeverities(null);
+ }
+
+ @Test
+ public void getSeverities_returns_object_from_setSeverities() {
+ underTest.setSeverities(LIST_OF_STRINGS);
+ assertThat(underTest.getSeverities()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getStatuses_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getStatuses()).isNull();
+ }
+
+ @Test
+ public void setStatuses_accepts_null() {
+ underTest.setStatuses(null);
+ }
+
+ @Test
+ public void getStatuses_returns_object_from_setStatuses() {
+ underTest.setStatuses(LIST_OF_STRINGS);
+ assertThat(underTest.getStatuses()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getTags_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getTags()).isNull();
+ }
+
+ @Test
+ public void setTags_accepts_null() {
+ underTest.setTags(null);
+ }
+
+ @Test
+ public void getTags_returns_object_from_setTags() {
+ underTest.setTags(LIST_OF_STRINGS);
+ assertThat(underTest.getTags()).isSameAs(LIST_OF_STRINGS);
+ }
+
+ @Test
+ public void getAsc_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getAsc()).isNull();
+ }
+
+ @Test
+ public void getAsc_returns_boolean_from_setTags() {
+ underTest.setAsc(true);
+ assertThat(underTest.getAsc()).isTrue();
+ underTest.setAsc(false);
+ assertThat(underTest.getAsc()).isFalse();
+ }
+
+ @Test
+ public void getAssigned_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getAssigned()).isNull();
+ }
+
+ @Test
+ public void setAssigned_accepts_null() {
+ underTest.setAssigned(null);
+ }
+
+ @Test
+ public void getAssigned_returns_boolean_from_setTags() {
+ underTest.setAssigned(true);
+ assertThat(underTest.getAssigned()).isTrue();
+ underTest.setAssigned(false);
+ assertThat(underTest.getAssigned()).isFalse();
+ }
+
+ @Test
+ public void getOnComponentOnly_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getOnComponentOnly()).isNull();
+ }
+
+ @Test
+ public void setOnComponentOnly_accepts_null() {
+ underTest.setOnComponentOnly(null);
+ }
+
+ @Test
+ public void getOnComponentOnly_returns_boolean_from_setOnComponentOnly() {
+ underTest.setOnComponentOnly(true);
+ assertThat(underTest.getOnComponentOnly()).isTrue();
+ underTest.setOnComponentOnly(false);
+ assertThat(underTest.getOnComponentOnly()).isFalse();
+ }
+
+ @Test
+ public void getResolved_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getResolved()).isNull();
+ }
+
+ @Test
+ public void setResolved_accepts_null() {
+ underTest.setResolved(null);
+ }
+
+ @Test
+ public void getResolved_returns_boolean_from_setResolved() {
+ underTest.setResolved(true);
+ assertThat(underTest.getResolved()).isTrue();
+ underTest.setResolved(false);
+ assertThat(underTest.getResolved()).isFalse();
+ }
+
+ @Test
+ public void getCreatedAfter_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getCreatedAfter()).isNull();
+ }
+
+ @Test
+ public void setCreatedAfter_accepts_null() {
+ underTest.setCreatedAfter(null);
+ }
+
+ @Test
+ public void getCreatedAfter_returns_object_from_setCreatedAfter() {
+ underTest.setCreatedAfter(SOME_STRING);
+ assertThat(underTest.getCreatedAfter()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getCreatedAt_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getCreatedAt()).isNull();
+ }
+
+ @Test
+ public void setCreatedAt_accepts_null() {
+ underTest.setCreatedAt(null);
+ }
+
+ @Test
+ public void getCreatedAt_returns_object_from_setCreatedAt() {
+ underTest.setCreatedAt(SOME_STRING);
+ assertThat(underTest.getCreatedAt()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getCreatedBefore_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getCreatedBefore()).isNull();
+ }
+
+ @Test
+ public void setCreatedBefore_accepts_null() {
+ underTest.setCreatedBefore(null);
+ }
+
+ @Test
+ public void getCreatedBefore_returns_object_from_setCreatedBefore() {
+ underTest.setCreatedBefore(SOME_STRING);
+ assertThat(underTest.getCreatedBefore()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getCreatedInLast_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getCreatedInLast()).isNull();
+ }
+
+ @Test
+ public void setCreatedInLast_accepts_null() {
+ underTest.setCreatedInLast(null);
+ }
+
+ @Test
+ public void getCreatedInLast_returns_object_from_setCreatedInLast() {
+ underTest.setCreatedInLast(SOME_STRING);
+ assertThat(underTest.getCreatedInLast()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getFacetMode_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getFacetMode()).isNull();
+ }
+
+ @Test
+ public void setFacetMode_accepts_null() {
+ underTest.setFacetMode(null);
+ }
+
+ @Test
+ public void getFacetMode_returns_object_from_setFacetMode() {
+ underTest.setFacetMode(SOME_STRING);
+ assertThat(underTest.getFacetMode()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getSort_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getSort()).isNull();
+ }
+
+ @Test
+ public void setSort_accepts_null() {
+ underTest.setSort(null);
+ }
+
+ @Test
+ public void getSort_returns_object_from_setSort() {
+ underTest.setSort(SOME_STRING);
+ assertThat(underTest.getSort()).isEqualTo(SOME_STRING);
+ }
+
+ @Test
+ public void getPage_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getPage()).isNull();
+ }
+
+ @Test
+ public void getPage_returns_object_from_setPage() {
+ underTest.setPage(SOME_INT);
+ assertThat(underTest.getPage()).isEqualTo(SOME_INT);
+ }
+
+ @Test
+ public void getPageSize_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
+ assertThat(underTest.getPageSize()).isNull();
+ }
+
+ @Test
+ public void getPageSize_returns_object_from_setPageSize() {
+ underTest.setPageSize(SOME_INT);
+ assertThat(underTest.getPageSize()).isEqualTo(SOME_INT);
+ }
+
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.collect.ImmutableList;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SearchWsRequestTest {
- private static final ImmutableList<String> LIST_OF_STRINGS = ImmutableList.of("A", "B");
- private static final String SOME_STRING = "some string";
- public static final int SOME_INT = 894352;
-
- private SearchWsRequest underTest = new SearchWsRequest();
-
- @Test
- public void getActionPlans_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getActionPlans()).isNull();
- }
-
- @Test
- public void setActionPlans_accepts_null() {
- underTest.setActionPlans(null);
- }
-
- @Test
- public void getActionPlans_returns_object_from_setActionPlans() {
- underTest.setActionPlans(LIST_OF_STRINGS);
-
- assertThat(underTest.getActionPlans()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getAdditionalFields_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getAdditionalFields()).isNull();
- }
-
- @Test
- public void setAdditionalFields_accepts_null() {
- underTest.setAdditionalFields(null);
- }
-
- @Test
- public void getAdditionalFields_returns_object_from_setAdditionalFields() {
- underTest.setAdditionalFields(LIST_OF_STRINGS);
- assertThat(underTest.getAdditionalFields()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getAssignees_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getAssignees()).isNull();
- }
-
- @Test
- public void setAssignees_accepts_null() {
- underTest.setAssignees(null);
- }
-
- @Test
- public void getAssignees_returns_object_from_setAssignees() {
- underTest.setAssignees(LIST_OF_STRINGS);
- assertThat(underTest.getAssignees()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getAuthors_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getAuthors()).isNull();
- }
-
- @Test
- public void setAuthors_accepts_null() {
- underTest.setAuthors(null);
- }
-
- @Test
- public void getAuthors_returns_object_from_setAuthors() {
- underTest.setAuthors(LIST_OF_STRINGS);
- assertThat(underTest.getAuthors()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getComponentKeys_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getComponentKeys()).isNull();
- }
-
- @Test
- public void setComponentKeys_accepts_null() {
- underTest.setComponentKeys(null);
- }
-
- @Test
- public void getComponentKeys_returns_object_from_setComponentKeys() {
- underTest.setComponentKeys(LIST_OF_STRINGS);
- assertThat(underTest.getComponentKeys()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getComponentRootUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getComponentRootUuids()).isNull();
- }
-
- @Test
- public void setComponentRootUuids_accepts_null() {
- underTest.setComponentRootUuids(null);
- }
-
- @Test
- public void getComponentRootUuids_returns_object_from_setComponentRootUuids() {
- underTest.setComponentRootUuids(LIST_OF_STRINGS);
- assertThat(underTest.getComponentRootUuids()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getComponentRoots_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getComponentRoots()).isNull();
- }
-
- @Test
- public void setComponentRoots_accepts_null() {
- underTest.setComponentRoots(null);
- }
-
- @Test
- public void getComponentRoots_returns_object_from_setComponentRoots() {
- underTest.setComponentRoots(LIST_OF_STRINGS);
- assertThat(underTest.getComponentRoots()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getComponentUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getComponentUuids()).isNull();
- }
-
- @Test
- public void setComponentUuids_accepts_null() {
- underTest.setComponentUuids(null);
- }
-
- @Test
- public void getComponentUuids_returns_object_from_setComponentUuids() {
- underTest.setComponentUuids(LIST_OF_STRINGS);
- assertThat(underTest.getComponentUuids()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getComponents_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getComponents()).isNull();
- }
-
- @Test
- public void setComponents_accepts_null() {
- underTest.setComponents(null);
- }
-
- @Test
- public void getComponents_returns_object_from_setComponents() {
- underTest.setComponents(LIST_OF_STRINGS);
- assertThat(underTest.getComponents()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getDirectories_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getDirectories()).isNull();
- }
-
- @Test
- public void setDirectories_accepts_null() {
- underTest.setDirectories(null);
- }
-
- @Test
- public void getDirectories_returns_object_from_setDirectories() {
- underTest.setDirectories(LIST_OF_STRINGS);
- assertThat(underTest.getDirectories()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getFacets_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getFacets()).isNull();
- }
-
- @Test
- public void setFacets_accepts_null() {
- underTest.setFacets(null);
- }
-
- @Test
- public void getFacets_returns_object_from_setFacets() {
- underTest.setFacets(LIST_OF_STRINGS);
- assertThat(underTest.getFacets()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getFileUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getFileUuids()).isNull();
- }
-
- @Test
- public void setFileUuids_accepts_null() {
- underTest.setFileUuids(null);
- }
-
- @Test
- public void getFileUuids_returns_object_from_setFileUuids() {
- underTest.setFileUuids(LIST_OF_STRINGS);
- assertThat(underTest.getFileUuids()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getIssues_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getIssues()).isNull();
- }
-
- @Test
- public void setIssues_accepts_null() {
- underTest.setIssues(null);
- }
-
- @Test
- public void getIssues_returns_object_from_setIssues() {
- underTest.setIssues(LIST_OF_STRINGS);
- assertThat(underTest.getIssues()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getLanguages_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getLanguages()).isNull();
- }
-
- @Test
- public void setLanguages_accepts_null() {
- underTest.setLanguages(null);
- }
-
- @Test
- public void getLanguages_returns_object_from_setLanguages() {
- underTest.setLanguages(LIST_OF_STRINGS);
- assertThat(underTest.getLanguages()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getModuleUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getModuleUuids()).isNull();
- }
-
- @Test
- public void setModuleUuids_accepts_null() {
- underTest.setModuleUuids(null);
- }
-
- @Test
- public void getModuleUuids_returns_object_from_setModuleUuids() {
- underTest.setModuleUuids(LIST_OF_STRINGS);
- assertThat(underTest.getModuleUuids()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getProjectKeys_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getProjectKeys()).isNull();
- }
-
- @Test
- public void setProjectKeys_accepts_null() {
- underTest.setProjectKeys(null);
- }
-
- @Test
- public void getProjectKeys_returns_object_from_setProjectKeys() {
- underTest.setProjectKeys(LIST_OF_STRINGS);
- assertThat(underTest.getProjectKeys()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getProjectUuids_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getProjectUuids()).isNull();
- }
-
- @Test
- public void setProjectUuids_accepts_null() {
- underTest.setProjectUuids(null);
- }
-
- @Test
- public void getProjectUuids_returns_object_from_setProjectUuids() {
- underTest.setProjectUuids(LIST_OF_STRINGS);
- assertThat(underTest.getProjectUuids()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getProjects_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getProjects()).isNull();
- }
-
- @Test
- public void setProjects_accepts_null() {
- underTest.setProjects(null);
- }
-
- @Test
- public void getProjects_returns_object_from_setProjects() {
- underTest.setProjects(LIST_OF_STRINGS);
- assertThat(underTest.getProjects()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getResolutions_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getResolutions()).isNull();
- }
-
- @Test
- public void setResolutions_accepts_null() {
- underTest.setResolutions(null);
- }
-
- @Test
- public void getResolutions_returns_object_from_setResolutions() {
- underTest.setResolutions(LIST_OF_STRINGS);
- assertThat(underTest.getResolutions()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getRules_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getRules()).isNull();
- }
-
- @Test
- public void setRules_accepts_null() {
- underTest.setRules(null);
- }
-
- @Test
- public void getRules_returns_object_from_setRules() {
- underTest.setRules(LIST_OF_STRINGS);
- assertThat(underTest.getRules()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getSeverities_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getSeverities()).isNull();
- }
-
- @Test
- public void setSeverities_accepts_null() {
- underTest.setSeverities(null);
- }
-
- @Test
- public void getSeverities_returns_object_from_setSeverities() {
- underTest.setSeverities(LIST_OF_STRINGS);
- assertThat(underTest.getSeverities()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getStatuses_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getStatuses()).isNull();
- }
-
- @Test
- public void setStatuses_accepts_null() {
- underTest.setStatuses(null);
- }
-
- @Test
- public void getStatuses_returns_object_from_setStatuses() {
- underTest.setStatuses(LIST_OF_STRINGS);
- assertThat(underTest.getStatuses()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getTags_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getTags()).isNull();
- }
-
- @Test
- public void setTags_accepts_null() {
- underTest.setTags(null);
- }
-
- @Test
- public void getTags_returns_object_from_setTags() {
- underTest.setTags(LIST_OF_STRINGS);
- assertThat(underTest.getTags()).isSameAs(LIST_OF_STRINGS);
- }
-
- @Test
- public void getAsc_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getAsc()).isNull();
- }
-
- @Test
- public void getAsc_returns_boolean_from_setTags() {
- underTest.setAsc(true);
- assertThat(underTest.getAsc()).isTrue();
- underTest.setAsc(false);
- assertThat(underTest.getAsc()).isFalse();
- }
-
- @Test
- public void getAssigned_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getAssigned()).isNull();
- }
-
- @Test
- public void setAssigned_accepts_null() {
- underTest.setAssigned(null);
- }
-
- @Test
- public void getAssigned_returns_boolean_from_setTags() {
- underTest.setAssigned(true);
- assertThat(underTest.getAssigned()).isTrue();
- underTest.setAssigned(false);
- assertThat(underTest.getAssigned()).isFalse();
- }
-
- @Test
- public void getOnComponentOnly_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getOnComponentOnly()).isNull();
- }
-
- @Test
- public void setOnComponentOnly_accepts_null() {
- underTest.setOnComponentOnly(null);
- }
-
- @Test
- public void getOnComponentOnly_returns_boolean_from_setOnComponentOnly() {
- underTest.setOnComponentOnly(true);
- assertThat(underTest.getOnComponentOnly()).isTrue();
- underTest.setOnComponentOnly(false);
- assertThat(underTest.getOnComponentOnly()).isFalse();
- }
-
- @Test
- public void getResolved_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getResolved()).isNull();
- }
-
- @Test
- public void setResolved_accepts_null() {
- underTest.setResolved(null);
- }
-
- @Test
- public void getResolved_returns_boolean_from_setResolved() {
- underTest.setResolved(true);
- assertThat(underTest.getResolved()).isTrue();
- underTest.setResolved(false);
- assertThat(underTest.getResolved()).isFalse();
- }
-
- @Test
- public void getCreatedAfter_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getCreatedAfter()).isNull();
- }
-
- @Test
- public void setCreatedAfter_accepts_null() {
- underTest.setCreatedAfter(null);
- }
-
- @Test
- public void getCreatedAfter_returns_object_from_setCreatedAfter() {
- underTest.setCreatedAfter(SOME_STRING);
- assertThat(underTest.getCreatedAfter()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getCreatedAt_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getCreatedAt()).isNull();
- }
-
- @Test
- public void setCreatedAt_accepts_null() {
- underTest.setCreatedAt(null);
- }
-
- @Test
- public void getCreatedAt_returns_object_from_setCreatedAt() {
- underTest.setCreatedAt(SOME_STRING);
- assertThat(underTest.getCreatedAt()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getCreatedBefore_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getCreatedBefore()).isNull();
- }
-
- @Test
- public void setCreatedBefore_accepts_null() {
- underTest.setCreatedBefore(null);
- }
-
- @Test
- public void getCreatedBefore_returns_object_from_setCreatedBefore() {
- underTest.setCreatedBefore(SOME_STRING);
- assertThat(underTest.getCreatedBefore()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getCreatedInLast_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getCreatedInLast()).isNull();
- }
-
- @Test
- public void setCreatedInLast_accepts_null() {
- underTest.setCreatedInLast(null);
- }
-
- @Test
- public void getCreatedInLast_returns_object_from_setCreatedInLast() {
- underTest.setCreatedInLast(SOME_STRING);
- assertThat(underTest.getCreatedInLast()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getFacetMode_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getFacetMode()).isNull();
- }
-
- @Test
- public void setFacetMode_accepts_null() {
- underTest.setFacetMode(null);
- }
-
- @Test
- public void getFacetMode_returns_object_from_setFacetMode() {
- underTest.setFacetMode(SOME_STRING);
- assertThat(underTest.getFacetMode()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getSort_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getSort()).isNull();
- }
-
- @Test
- public void setSort_accepts_null() {
- underTest.setSort(null);
- }
-
- @Test
- public void getSort_returns_object_from_setSort() {
- underTest.setSort(SOME_STRING);
- assertThat(underTest.getSort()).isEqualTo(SOME_STRING);
- }
-
- @Test
- public void getPage_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getPage()).isNull();
- }
-
- @Test
- public void getPage_returns_object_from_setPage() {
- underTest.setPage(SOME_INT);
- assertThat(underTest.getPage()).isEqualTo(SOME_INT);
- }
-
- @Test
- public void getPageSize_returns_null_when_SearchWsRequest_has_just_been_instantiated() {
- assertThat(underTest.getPageSize()).isNull();
- }
-
- @Test
- public void getPageSize_returns_object_from_setPageSize() {
- underTest.setPageSize(SOME_INT);
- assertThat(underTest.getPageSize()).isEqualTo(SOME_INT);
- }
-
-}
@Test
public void component() {
- ComponentWsRequest request = new ComponentWsRequest()
+ ComponentRequest request = new ComponentRequest()
.setComponentId(VALUE_BASE_COMPONENT_ID)
.setComponentKey(VALUE_BASE_COMPONENT_KEY)
.setComponent(VALUE_BASE_COMPONENT_KEY)
@Test
public void component_tree() {
- ComponentTreeWsRequest componentTreeRequest = new ComponentTreeWsRequest()
+ ComponentTreeRequest componentTreeRequest = new ComponentTreeRequest()
.setBaseComponentId(VALUE_BASE_COMPONENT_ID)
.setBaseComponentKey(VALUE_BASE_COMPONENT_KEY)
.setComponent(VALUE_BASE_COMPONENT_KEY)
@Test
public void search() {
- underTest.search(SearchWsRequest.builder()
+ underTest.search(SearchRequest.builder()
.setOrganizations("orga1", "orga2")
.setPage(2)
.setPageSize(10)
@Test
public void search_members() {
- underTest.searchMembers(new SearchMembersWsRequest()
+ underTest.searchMembers(new SearchMembersRequest()
.setOrganization("orga")
.setSelected("selected")
.setQuery("john")
@Test
public void update_project_visibility() {
- underTest.updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder()
+ underTest.updateProjectVisibility(UpdateProjectVisibilityRequest.builder()
.setOrganization("O1")
.setProjectVisibility("private")
.build());
@Test
public void groups_does_POST_on_WS_groups() {
- GroupsWsRequest request = new GroupsWsRequest();
+ GroupsRequest request = new GroupsRequest();
underTest.groups(request
.setPermission(PERMISSION_VALUE)
.setProjectId(PROJECT_ID_VALUE)
@Test
public void addGroup_does_POST_on_Ws_add_group() {
- underTest.addGroup(new AddGroupWsRequest()
+ underTest.addGroup(new AddGroupRequest()
.setOrganization(ORGANIZATION_VALUE)
.setPermission(PERMISSION_VALUE)
.setProjectId(PROJECT_ID_VALUE)
@Test
public void addGroupToTemplate_does_POST_on_Ws_add_group_to_template() {
underTest.addGroupToTemplate(
- new AddGroupToTemplateWsRequest()
+ new AddGroupToTemplateRequest()
.setGroupId(GROUP_ID_VALUE)
.setGroupName(GROUP_NAME_VALUE)
.setPermission(PERMISSION_VALUE)
@Test
public void addUser_does_POST_on_Ws_add_user() {
- underTest.addUser(new AddUserWsRequest()
+ underTest.addUser(new AddUserRequest()
.setLogin(LOGIN_VALUE)
.setOrganization(ORGANIZATION_VALUE)
.setPermission(PERMISSION_VALUE)
@Test
public void addUserToTemplate_does_POST_on_Ws_add_user_to_template() {
- underTest.addUserToTemplate(new AddUserToTemplateWsRequest()
+ underTest.addUserToTemplate(new AddUserToTemplateRequest()
.setOrganization(ORGANIZATION_VALUE)
.setPermission(PERMISSION_VALUE)
.setLogin(LOGIN_VALUE)
@Test
public void applyTemplate_does_POST_on_Ws_apply_template() {
- underTest.applyTemplate(new ApplyTemplateWsRequest()
+ underTest.applyTemplate(new ApplyTemplateRequest()
.setOrganization(ORGANIZATION_VALUE)
.setProjectId(PROJECT_ID_VALUE)
.setProjectKey(PROJECT_KEY_VALUE)
@Test
public void bulk_apply_template() {
- underTest.bulkApplyTemplate(new BulkApplyTemplateWsRequest()
+ underTest.bulkApplyTemplate(new BulkApplyTemplateRequest()
.setOrganization(ORGANIZATION_VALUE)
.setTemplateId(TEMPLATE_ID_VALUE)
.setTemplateName(TEMPLATE_NAME_VALUE)
@Test
public void createTemplate_does_POST_on_Ws_create_template() {
- underTest.createTemplate(new CreateTemplateWsRequest()
+ underTest.createTemplate(new CreateTemplateRequest()
.setOrganization(ORGANIZATION_VALUE)
.setName(NAME_VALUE)
.setDescription(DESCRIPTION_VALUE)
@Test
public void deleteTemplate_does_POST_on_Ws_delete_template() {
- underTest.deleteTemplate(new DeleteTemplateWsRequest()
+ underTest.deleteTemplate(new DeleteTemplateRequest()
.setTemplateId(TEMPLATE_ID_VALUE)
.setTemplateName(TEMPLATE_NAME_VALUE)
.setOrganization(ORGANIZATION_VALUE)
@Test
public void removeGroup_does_POST_on_Ws_remove_group() {
- underTest.removeGroup(new RemoveGroupWsRequest()
+ underTest.removeGroup(new RemoveGroupRequest()
.setPermission(PERMISSION_VALUE)
.setGroupId(GROUP_ID_VALUE)
.setGroupName(GROUP_NAME_VALUE)
@Test
public void removeGroupFromTemplate_does_POST_on_Ws_remove_group_from_template() {
- underTest.removeGroupFromTemplate(new RemoveGroupFromTemplateWsRequest()
+ underTest.removeGroupFromTemplate(new RemoveGroupFromTemplateRequest()
.setPermission(PERMISSION_VALUE)
.setGroupId(GROUP_ID_VALUE)
.setGroupName(GROUP_NAME_VALUE)
@Test
public void removeUser_does_POST_on_Ws_remove_user() {
- underTest.removeUser(new RemoveUserWsRequest()
+ underTest.removeUser(new RemoveUserRequest()
.setPermission(PERMISSION_VALUE)
.setLogin(LOGIN_VALUE)
.setProjectId(PROJECT_ID_VALUE)
@Test
public void removeUserFromTemplate_does_POST_on_Ws_remove_user_from_template() {
- underTest.removeUserFromTemplate(new RemoveUserFromTemplateWsRequest()
+ underTest.removeUserFromTemplate(new RemoveUserFromTemplateRequest()
.setPermission(PERMISSION_VALUE)
.setLogin(LOGIN_VALUE)
.setTemplateId(TEMPLATE_ID_VALUE)
@Test
public void searchProjectPermissions_does_GET_on_Ws_search_project_permissions() {
- underTest.searchProjectPermissions(new SearchProjectPermissionsWsRequest()
+ underTest.searchProjectPermissions(new SearchProjectPermissionsRequest()
.setProjectId(PROJECT_ID_VALUE)
.setProjectKey(PROJECT_KEY_VALUE)
.setQualifier(QUALIFIER_VALUE)
@Test
public void searchTemplates_does_GET_on_Ws_search_templates() {
- underTest.searchTemplates(new SearchTemplatesWsRequest()
+ underTest.searchTemplates(new SearchTemplatesRequest()
.setQuery(QUERY_VALUE)
);
@Test
public void setDefaultTemplate_does_POST_on_Ws_set_default_template() {
- underTest.setDefaultTemplate(new SetDefaultTemplateWsRequest()
+ underTest.setDefaultTemplate(new SetDefaultTemplateRequest()
.setQualifier(QUALIFIER_VALUE)
.setTemplateId(TEMPLATE_ID_VALUE)
.setTemplateName(TEMPLATE_NAME_VALUE)
@Test
public void updateTemplate_does_POST_on_Ws_update_template() {
- underTest.updateTemplate(new UpdateTemplateWsRequest()
+ underTest.updateTemplate(new UpdateTemplateRequest()
.setDescription(DESCRIPTION_VALUE)
.setId(TEMPLATE_ID_VALUE)
.setName(TEMPLATE_NAME_VALUE)
@Test
public void add_project_creator_to_template() {
- underTest.addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.builder()
+ underTest.addProjectCreatorToTemplate(AddProjectCreatorToTemplateRequest.builder()
.setPermission(PERMISSION_VALUE)
.setTemplateId(TEMPLATE_ID_VALUE)
.setTemplateName(TEMPLATE_NAME_VALUE)
@Test
public void remove_project_creator_from_template() {
- underTest.removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateWsRequest.builder()
+ underTest.removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateRequest.builder()
.setPermission(PERMISSION_VALUE)
.setTemplateId(TEMPLATE_ID_VALUE)
.setTemplateName(TEMPLATE_NAME_VALUE)
@Test
public void users() {
- underTest.users(new UsersWsRequest()
+ underTest.users(new UsersRequest()
.setOrganization("org")
.setProjectKey("project")
.setProjectId("ABCD")
@Test
public void bulk_delete() {
- underTest.bulkDelete(SearchWsRequest.builder()
+ underTest.bulkDelete(SearchRequest.builder()
.setOrganization("default")
.setQuery("project")
.setQualifiers(asList("TRK", "VW"))
@Test
public void search() {
- underTest.search(SearchWsRequest.builder()
+ underTest.search(SearchRequest.builder()
.setOrganization("default")
.setQuery("project")
.setQualifiers(asList("TRK", "VW"))
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.project;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static java.util.Arrays.asList;
+import static java.util.Collections.emptyList;
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SearchRequestTest {
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ @Test
+ public void create_request() throws Exception {
+ SearchRequest underTest = SearchRequest.builder()
+ .setOrganization("orga")
+ .setQuery("project")
+ .setQualifiers(asList("TRK", "VW"))
+ .setPage(5)
+ .setPageSize(10)
+ .build();
+
+ assertThat(underTest.getOrganization()).isEqualTo("orga");
+ assertThat(underTest.getQuery()).isEqualTo("project");
+ assertThat(underTest.getQualifiers()).containsOnly("TRK", "VW");
+ assertThat(underTest.getPage()).isEqualTo(5);
+ assertThat(underTest.getPageSize()).isEqualTo(10);
+ }
+
+ @Test
+ public void fail_when_page_size_is_greater_then_500() throws Exception {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("Page size must not be greater than 500");
+
+ SearchRequest.builder()
+ .setPageSize(10000)
+ .build();
+ }
+
+ @Test
+ public void fail_if_project_key_list_is_empty() {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("Project key list must not be empty");
+
+ SearchRequest.builder()
+ .setProjects(emptyList())
+ .build();
+ }
+
+ @Test
+ public void fail_if_project_id_list_is_empty() {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("Project id list must not be empty");
+
+ SearchRequest.builder()
+ .setProjectIds(emptyList())
+ .build();
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.project;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static java.util.Arrays.asList;
-import static java.util.Collections.emptyList;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SearchWsRequestTest {
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- @Test
- public void create_request() throws Exception {
- SearchWsRequest underTest = SearchWsRequest.builder()
- .setOrganization("orga")
- .setQuery("project")
- .setQualifiers(asList("TRK", "VW"))
- .setPage(5)
- .setPageSize(10)
- .build();
-
- assertThat(underTest.getOrganization()).isEqualTo("orga");
- assertThat(underTest.getQuery()).isEqualTo("project");
- assertThat(underTest.getQualifiers()).containsOnly("TRK", "VW");
- assertThat(underTest.getPage()).isEqualTo(5);
- assertThat(underTest.getPageSize()).isEqualTo(10);
- }
-
- @Test
- public void fail_when_page_size_is_greater_then_500() throws Exception {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Page size must not be greater than 500");
-
- SearchWsRequest.builder()
- .setPageSize(10000)
- .build();
- }
-
- @Test
- public void fail_if_project_key_list_is_empty() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Project key list must not be empty");
-
- SearchWsRequest.builder()
- .setProjects(emptyList())
- .build();
- }
-
- @Test
- public void fail_if_project_id_list_is_empty() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Project id list must not be empty");
-
- SearchWsRequest.builder()
- .setProjectIds(emptyList())
- .build();
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.project;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+public class UpdateKeyRequestTest {
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ UpdateKeyRequest.Builder underTest = UpdateKeyRequest.builder();
+
+ @Test
+ public void fail_if_new_key_is_null() {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("The new key must not be empty");
+
+ underTest.setNewKey(null).build();
+ }
+
+ @Test
+ public void fail_if_new_key_is_empty() {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("The new key must not be empty");
+
+ underTest.setNewKey("").build();
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.project;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class UpdateKeyWsRequestTest {
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- UpdateKeyWsRequest.Builder underTest = UpdateKeyWsRequest.builder();
-
- @Test
- public void fail_if_new_key_is_null() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("The new key must not be empty");
-
- underTest.setNewKey(null).build();
- }
-
- @Test
- public void fail_if_new_key_is_empty() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("The new key must not be empty");
-
- underTest.setNewKey("").build();
- }
-}
@Test
public void search() {
- underTest.search(new SearchWsRequest()
+ underTest.search(new SearchRequest()
.setDefaults(true)
.setProjectKey("project")
.setLanguage("language")
@Test
public void activate_rule() {
- underTest.activateRule(ActivateRuleWsRequest.builder()
+ underTest.activateRule(ActivateRuleRequest.builder()
.setRuleKey("R1")
.setKey("P1")
.setOrganization("O1")
import org.sonarqube.ws.Projects;
import org.sonarqube.ws.Users.CreateWsResponse.User;
import org.sonarqube.ws.client.ce.TaskRequest;
-import org.sonarqube.ws.client.component.SuggestionsWsRequest;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.component.SuggestionsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
}
private Issues.SearchWsResponse searchIssues(String projectKey) {
- SearchWsRequest request = new SearchWsRequest()
+ SearchRequest request = new SearchRequest()
.setProjectKeys(Collections.singletonList(projectKey))
.setFacets(Collections.singletonList("statuses"));
return tester.wsClient().issues().search(request);
}
private List<String> searchFile(String key, Organization organization) {
- SuggestionsWsRequest query = SuggestionsWsRequest.builder()
+ SuggestionsRequest query = SuggestionsRequest.builder()
.setS(key)
.build();
Map<String, Object> response = ItUtils.jsonToMap(
import org.sonarqube.ws.Permissions;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.favorites.SearchRequest;
-import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequest;
-import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest;
+import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest;
+import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateRequest;
+import org.sonarqube.ws.client.permission.SearchTemplatesRequest;
import static com.sonar.orchestrator.container.Server.ADMIN_LOGIN;
import static com.sonar.orchestrator.container.Server.ADMIN_PASSWORD;
}
private void addProjectCreatorPermission() {
- Permissions.SearchTemplatesWsResponse permissionTemplates = adminWsClient.permissions().searchTemplates(new SearchTemplatesWsRequest());
+ Permissions.SearchTemplatesWsResponse permissionTemplates = adminWsClient.permissions().searchTemplates(new SearchTemplatesRequest());
assertThat(permissionTemplates.getDefaultTemplatesCount()).isEqualTo(1);
- adminWsClient.permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.builder()
+ adminWsClient.permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateRequest.builder()
.setTemplateId(permissionTemplates.getDefaultTemplates(0).getTemplateId())
.setPermission("admin")
.build());
}
private void removeProjectCreatorPermission() {
- Permissions.SearchTemplatesWsResponse permissionTemplates = adminWsClient.permissions().searchTemplates(new SearchTemplatesWsRequest());
+ Permissions.SearchTemplatesWsResponse permissionTemplates = adminWsClient.permissions().searchTemplates(new SearchTemplatesRequest());
assertThat(permissionTemplates.getDefaultTemplatesCount()).isEqualTo(1);
- adminWsClient.permissions().removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateWsRequest.builder()
+ adminWsClient.permissions().removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateRequest.builder()
.setTemplateId(permissionTemplates.getDefaultTemplates(0).getTemplateId())
.setPermission("admin")
.build());
import org.junit.ClassRule;
import org.junit.Test;
import org.sonarqube.ws.Components.Component;
-import org.sonarqube.ws.client.component.TreeWsRequest;
+import org.sonarqube.ws.client.component.TreeRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
}
public static List<Component> getComponents(String qualifier) {
- return newWsClient(orchestrator).components().tree(new TreeWsRequest().setBaseComponentKey(PROJECT).setQualifiers(singletonList(qualifier))).getComponentsList();
+ return newWsClient(orchestrator).components().tree(new TreeRequest().setBaseComponentKey(PROJECT).setQualifiers(singletonList(qualifier))).getComponentsList();
}
}
import org.junit.Test;
import org.sonarqube.ws.UserTokens;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.usertokens.GenerateRequest;
import org.sonarqube.ws.client.usertokens.RevokeRequest;
import org.sonarqube.ws.client.usertokens.UserTokensService;
}
private void addUserPermission(String login, String permission, @Nullable String projectKey) {
- adminWsClient.permissions().addUser(new AddUserWsRequest()
+ adminWsClient.permissions().addUser(new AddUserRequest()
.setLogin(login)
.setPermission(permission)
.setProjectKey(projectKey));
import org.junit.rules.TemporaryFolder;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.tests.Category3Suite;
-import org.sonarqube.ws.client.component.SearchWsRequest;
+import org.sonarqube.ws.client.component.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
scan("shared/xoo-multi-modules-sample");
scan("shared/xoo-multi-modules-sample", "sonar.branch", "branch/0.x");
- assertThat(tester.wsClient().components().search(new SearchWsRequest().setQualifiers(singletonList("TRK"))).getComponentsList()).hasSize(2);
+ assertThat(tester.wsClient().components().search(new SearchRequest().setQualifiers(singletonList("TRK"))).getComponentsList()).hasSize(2);
assertThat(getComponent(orchestrator, "com.sonarsource.it.samples:multi-modules-sample").getName()).isEqualTo("Sonar :: Integration Tests :: Multi-modules Sample");
assertThat(getComponent(orchestrator, "com.sonarsource.it.samples:multi-modules-sample:branch/0.x").getName())
.isEqualTo("Sonar :: Integration Tests :: Multi-modules Sample branch/0.x");
import org.junit.Rule;
import org.junit.Test;
import org.sonarqube.qa.util.Tester;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
-import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
+import org.sonarqube.ws.client.permission.AddGroupRequest;
+import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest;
+import org.sonarqube.ws.client.permission.RemoveGroupRequest;
import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void execute_analysis_with_scan_on_default_template() {
removeGlobalPermission("anyone", "scan");
- tester.wsClient().permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.builder()
+ tester.wsClient().permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateRequest.builder()
.setPermission("scan")
.setTemplateId("default_template")
.build());
}
private void addProjectPermission(String groupName, String projectKey, String permission) {
- tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName(groupName).setProjectKey(projectKey).setPermission(permission));
+ tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName(groupName).setProjectKey(projectKey).setPermission(permission));
}
private void addGlobalPermission(String groupName, String permission) {
- tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName(groupName).setPermission(permission));
+ tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName(groupName).setPermission(permission));
}
private void removeGlobalPermission(String groupName, String permission) {
- tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setGroupName(groupName).setPermission(permission));
+ tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setGroupName(groupName).setPermission(permission));
}
private static void executeLoggedAnalysis() {
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.client.issue.BulkChangeRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
import util.ItUtils;
private void addUserPermission(String login, String projectKey, String permission) {
tester.wsClient().permissions().addUser(
- new AddUserWsRequest()
+ new AddUserRequest()
.setLogin(login)
.setProjectKey(projectKey)
.setPermission(permission));
import org.sonarqube.ws.Permissions.Permission;
import org.sonarqube.ws.Permissions.SearchTemplatesWsResponse;
import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.permission.AddGroupToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
-import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
-import org.sonarqube.ws.client.permission.CreateTemplateWsRequest;
-import org.sonarqube.ws.client.permission.GroupsWsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupFromTemplateWsRequest;
-import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequest;
-import org.sonarqube.ws.client.permission.RemoveUserFromTemplateWsRequest;
-import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest;
-import org.sonarqube.ws.client.permission.UsersWsRequest;
+import org.sonarqube.ws.client.permission.AddGroupToTemplateRequest;
+import org.sonarqube.ws.client.permission.AddGroupRequest;
+import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest;
+import org.sonarqube.ws.client.permission.AddUserToTemplateRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
+import org.sonarqube.ws.client.permission.CreateTemplateRequest;
+import org.sonarqube.ws.client.permission.GroupsRequest;
+import org.sonarqube.ws.client.permission.RemoveGroupFromTemplateRequest;
+import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateRequest;
+import org.sonarqube.ws.client.permission.RemoveUserFromTemplateRequest;
+import org.sonarqube.ws.client.permission.SearchTemplatesRequest;
+import org.sonarqube.ws.client.permission.UsersRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void permission_web_services() {
tester.wsClient().permissions().addUser(
- new AddUserWsRequest()
+ new AddUserRequest()
.setPermission("admin")
.setLogin(LOGIN));
tester.wsClient().permissions().addGroup(
- new AddGroupWsRequest()
+ new AddGroupRequest()
.setPermission("admin")
.setGroupName(GROUP_NAME));
assertThat(searchGlobalPermissionsWsResponse.getPermissionsList().get(0).getGroupsCount()).isEqualTo(2);
Permissions.UsersWsResponse users = tester.wsClient().permissions()
- .users(new UsersWsRequest().setPermission("admin"));
+ .users(new UsersRequest().setPermission("admin"));
assertThat(users.getUsersList()).extracting("login").contains(LOGIN);
Permissions.WsGroupsResponse groupsResponse = tester.wsClient().permissions()
- .groups(new GroupsWsRequest()
+ .groups(new GroupsRequest()
.setPermission("admin"));
assertThat(groupsResponse.getGroupsList()).extracting("name").contains(GROUP_NAME);
}
@Test
public void template_permission_web_services() {
Permissions.CreateTemplateWsResponse createTemplateWsResponse = tester.wsClient().permissions().createTemplate(
- new CreateTemplateWsRequest()
+ new CreateTemplateRequest()
.setName("my-new-template")
.setDescription("template-used-in-tests"));
assertThat(createTemplateWsResponse.getPermissionTemplate().getName()).isEqualTo("my-new-template");
tester.wsClient().permissions().addUserToTemplate(
- new AddUserToTemplateWsRequest()
+ new AddUserToTemplateRequest()
.setPermission("admin")
.setTemplateName("my-new-template")
.setLogin(LOGIN));
tester.wsClient().permissions().addGroupToTemplate(
- new AddGroupToTemplateWsRequest()
+ new AddGroupToTemplateRequest()
.setPermission("admin")
.setTemplateName("my-new-template")
.setGroupName(GROUP_NAME));
tester.wsClient().permissions().addProjectCreatorToTemplate(
- AddProjectCreatorToTemplateWsRequest.builder()
+ AddProjectCreatorToTemplateRequest.builder()
.setPermission("admin")
.setTemplateName("my-new-template")
.build());
SearchTemplatesWsResponse searchTemplatesWsResponse = tester.wsClient().permissions().searchTemplates(
- new SearchTemplatesWsRequest()
+ new SearchTemplatesRequest()
.setQuery("my-new-template"));
assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getName()).isEqualTo("my-new-template");
assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getPermissions(0).getKey()).isEqualTo("admin");
assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getPermissions(0).getWithProjectCreator()).isTrue();
tester.wsClient().permissions().removeGroupFromTemplate(
- new RemoveGroupFromTemplateWsRequest()
+ new RemoveGroupFromTemplateRequest()
.setPermission("admin")
.setTemplateName("my-new-template")
.setGroupName(GROUP_NAME));
tester.wsClient().permissions().removeUserFromTemplate(
- new RemoveUserFromTemplateWsRequest()
+ new RemoveUserFromTemplateRequest()
.setPermission("admin")
.setTemplateName("my-new-template")
.setLogin(LOGIN));
tester.wsClient().permissions().removeProjectCreatorFromTemplate(
- RemoveProjectCreatorFromTemplateWsRequest.builder()
+ RemoveProjectCreatorFromTemplateRequest.builder()
.setPermission("admin")
.setTemplateName("my-new-template")
.build()
);
SearchTemplatesWsResponse clearedSearchTemplatesWsResponse = tester.wsClient().permissions().searchTemplates(
- new SearchTemplatesWsRequest()
+ new SearchTemplatesRequest()
.setQuery("my-new-template"));
assertThat(clearedSearchTemplatesWsResponse.getPermissionTemplates(0).getPermissionsList())
.extracting(Permission::getUsersCount, Permission::getGroupsCount, Permission::getWithProjectCreator)
import org.sonarqube.qa.util.Tester;
import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage;
import org.sonarqube.ws.Permissions;
-import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.CreateTemplateWsRequest;
-import org.sonarqube.ws.client.permission.UsersWsRequest;
+import org.sonarqube.ws.client.permission.AddUserToTemplateRequest;
+import org.sonarqube.ws.client.permission.CreateTemplateRequest;
+import org.sonarqube.ws.client.permission.UsersRequest;
import static org.assertj.core.api.Assertions.assertThat;
String userLogin = tester.users().generateMemberOfDefaultOrganization().getLogin();
String adminLogin = tester.users().generateAdministratorOnDefaultOrganization().getLogin();
- tester.wsClient().permissions().createTemplate(new CreateTemplateWsRequest().setName("foo-template"));
+ tester.wsClient().permissions().createTemplate(new CreateTemplateRequest().setName("foo-template"));
tester.wsClient().permissions().addUserToTemplate(
- new AddUserToTemplateWsRequest()
+ new AddUserToTemplateRequest()
.setPermission("admin")
.setTemplateName("foo-template")
.setLogin(userLogin));
ProjectsManagementPage page = tester.openBrowser().logIn().submitCredentials(adminLogin).openProjectsManagement();
page.shouldHaveProject(project);
page.bulkApplyPermissionTemplate("foo-template");
- Permissions.UsersWsResponse usersResponse = tester.wsClient().permissions().users(new UsersWsRequest()
+ Permissions.UsersWsResponse usersResponse = tester.wsClient().permissions().users(new UsersRequest()
.setProjectKey(project)
.setPermission("admin")
);
import org.sonarqube.ws.Users.CreateWsResponse;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.component.SearchProjectsRequest;
-import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest;
-import org.sonarqube.ws.client.permission.ApplyTemplateWsRequest;
-import org.sonarqube.ws.client.permission.BulkApplyTemplateWsRequest;
-import org.sonarqube.ws.client.permission.CreateTemplateWsRequest;
+import org.sonarqube.ws.client.permission.AddUserToTemplateRequest;
+import org.sonarqube.ws.client.permission.ApplyTemplateRequest;
+import org.sonarqube.ws.client.permission.BulkApplyTemplateRequest;
+import org.sonarqube.ws.client.permission.CreateTemplateRequest;
import org.sonarqube.ws.client.permission.PermissionsService;
-import org.sonarqube.ws.client.permission.UsersWsRequest;
+import org.sonarqube.ws.client.permission.UsersRequest;
import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.assertj.core.api.Assertions.assertThat;
CreateWsResponse.User user = tester.users().generateMember(organization);
CreateWsResponse.User anotherUser = tester.users().generateMember(organization);
Permissions.PermissionTemplate template = createTemplate(organization).getPermissionTemplate();
- tester.wsClient().permissions().addUserToTemplate(new AddUserToTemplateWsRequest()
+ tester.wsClient().permissions().addUserToTemplate(new AddUserToTemplateRequest()
.setOrganization(organization.getKey())
.setTemplateId(template.getId())
.setLogin(user.getLogin())
Project project2 = createPrivateProject(organization);
Project untouchedProject = createPrivateProject(organization);
- tester.wsClient().permissions().bulkApplyTemplate(new BulkApplyTemplateWsRequest()
+ tester.wsClient().permissions().bulkApplyTemplate(new BulkApplyTemplateRequest()
.setOrganization(organization.getKey())
.setTemplateId(template.getId())
.setProjects(Arrays.asList(project1.getKey(), project2.getKey())));
private void createAndApplyTemplate(Organization organization, Project project, CreateWsResponse.User user) {
String templateName = "For user";
PermissionsService service = tester.wsClient().permissions();
- service.createTemplate(new CreateTemplateWsRequest()
+ service.createTemplate(new CreateTemplateRequest()
.setOrganization(organization.getKey())
.setName(templateName)
.setDescription("Give admin permissions to single user"));
- service.addUserToTemplate(new AddUserToTemplateWsRequest()
+ service.addUserToTemplate(new AddUserToTemplateRequest()
.setOrganization(organization.getKey())
.setLogin(user.getLogin())
.setPermission("user")
.setTemplateName(templateName));
- service.applyTemplate(new ApplyTemplateWsRequest()
+ service.applyTemplate(new ApplyTemplateRequest()
.setOrganization(organization.getKey())
.setProjectKey(project.getKey())
.setTemplateName(templateName));
}
private CreateTemplateWsResponse createTemplate(Organization organization) {
- return tester.wsClient().permissions().createTemplate(new CreateTemplateWsRequest()
+ return tester.wsClient().permissions().createTemplate(new CreateTemplateRequest()
.setOrganization(organization.getKey())
.setName(randomAlphabetic(20)));
}
}
private boolean hasBrowsePermission(CreateWsResponse.User user, Organization organization, Project project) {
- UsersWsRequest request = new UsersWsRequest()
+ UsersRequest request = new UsersRequest()
.setOrganization(organization.getKey())
.setProjectKey(project.getKey())
.setPermission("user");
import org.junit.rules.RuleChain;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Projects.CreateWsResponse.Project;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
-import org.sonarqube.ws.client.permission.RemoveUserWsRequest;
+import org.sonarqube.ws.client.permission.AddGroupRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
+import org.sonarqube.ws.client.permission.RemoveGroupRequest;
+import org.sonarqube.ws.client.permission.RemoveUserRequest;
import org.sonarqube.ws.client.project.CreateRequest;
import util.ItUtils;
@BeforeClass
public static void init() {
// remove default permission "provisioning" from anyone();
- tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setGroupName("anyone").setPermission("provisioning"));
+ tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setGroupName("anyone").setPermission("provisioning"));
tester.users().generate(u -> u.setLogin(ADMIN_WITH_PROVISIONING).setPassword(PASSWORD));
addUserPermission(ADMIN_WITH_PROVISIONING, "admin");
@AfterClass
public static void restoreData() throws Exception {
- tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName("anyone").setPermission("provisioning"));
+ tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName("anyone").setPermission("provisioning"));
}
/**
}
private static void addUserPermission(String login, String permission) {
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission(permission));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(login).setPermission(permission));
}
private static void removeUserPermission(String login, String permission) {
- tester.wsClient().permissions().removeUser(new RemoveUserWsRequest().setLogin(login).setPermission(permission));
+ tester.wsClient().permissions().removeUser(new RemoveUserRequest().setLogin(login).setPermission(permission));
}
}
import org.junit.Rule;
import org.junit.Test;
import org.sonarqube.qa.util.Tester;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.qualityprofile.CreateRequest;
import util.selenium.Selenese;
tester.users().generate(u -> u.setLogin("not_profileadm").setPassword("userpwd"));
tester.users().generate(u -> u.setLogin("profileadm").setPassword("papwd"));
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin("profileadm").setPermission("profileadmin"));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin("profileadm").setPermission("profileadmin"));
createProfile("xoo", "foo");
Selenese.runSelenese(orchestrator,
import org.sonarqube.ws.Users;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
Projects.CreateWsResponse.Project project2 = tester.projects().provision(organization, t -> t.setName("Project2"));
Projects.CreateWsResponse.Project project3 = tester.projects().provision(organization, t -> t.setName("Project3"));
// user 1 is admin of project 1 and will subscribe to global notifications
- tester.wsClient().permissions().addUser(new AddUserWsRequest()
+ tester.wsClient().permissions().addUser(new AddUserRequest()
.setLogin(user1.getLogin())
.setPermission("admin")
.setProjectKey(project1.getKey()));
// user 2 is admin of project 2 but won't subscribe to global notifications
- tester.wsClient().permissions().addUser(new AddUserWsRequest()
+ tester.wsClient().permissions().addUser(new AddUserRequest()
.setLogin(user2.getLogin())
.setPermission("admin")
.setProjectKey(project2.getKey()));
import org.junit.rules.RuleChain;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Components;
-import org.sonarqube.ws.client.component.SearchWsRequest;
-import org.sonarqube.ws.client.component.ShowWsRequest;
+import org.sonarqube.ws.client.component.SearchRequest;
+import org.sonarqube.ws.client.component.ShowRequest;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void show() {
- Components.ShowWsResponse response = tester.wsClient().components().show(new ShowWsRequest().setKey(FILE_KEY));
+ Components.ShowWsResponse response = tester.wsClient().components().show(new ShowRequest().setKey(FILE_KEY));
assertThat(response).isNotNull();
assertThat(response.getComponent().getKey()).isEqualTo(FILE_KEY);
@Test
public void search() {
- Components.SearchWsResponse response = tester.wsClient().components().search(new SearchWsRequest()
+ Components.SearchWsResponse response = tester.wsClient().components().search(new SearchRequest()
.setQualifiers(singletonList("FIL")));
assertThat(response).isNotNull();
import org.junit.rules.RuleChain;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import util.issue.IssueRule;
@Test
public void issue_on_duplicated_blocks_is_generated_on_file() throws Exception {
- assertThat(issueRule.search(new SearchWsRequest().setComponentKeys(singletonList(DUPLICATE_FILE)).setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList())
+ assertThat(issueRule.search(new SearchRequest().setComponentKeys(singletonList(DUPLICATE_FILE)).setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList())
.hasSize(1);
}
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import util.issue.IssueRule;
@Test
public void issues_on_duplicated_blocks_are_generated_on_each_file() throws Exception {
- assertThat(issueRule.search(new SearchWsRequest().setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()).hasSize(13);
+ assertThat(issueRule.search(new SearchRequest().setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()).hasSize(13);
}
@Test
import org.junit.Test;
import org.sonarqube.ws.Issues.Issue;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
private List<Issue> findIssues(String componentKey, String ruleKey) {
return adminWsClient.issues().search(
- new SearchWsRequest()
+ new SearchRequest()
.setComponents(singletonList(componentKey))
.setRules(singletonList(ruleKey)))
.getIssuesList();
import org.sonarqube.ws.client.issue.AssignRequest;
import org.sonarqube.ws.client.issue.EditCommentRequest;
import org.sonarqube.ws.client.issue.IssuesService;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import org.sonarqube.ws.client.issue.SetSeverityRequest;
import util.ProjectAnalysis;
import util.ProjectAnalysisRule;
@Test
public void assign() {
assertThat(randomIssue.hasAssignee()).isFalse();
- Issues.SearchWsResponse response = issueRule.search(new SearchWsRequest().setIssues(singletonList(randomIssue.getKey())));
+ Issues.SearchWsResponse response = issueRule.search(new SearchRequest().setIssues(singletonList(randomIssue.getKey())));
assertThat(response.getUsers().getUsersList()).isEmpty();
issuesService.assign(new AssignRequest(randomIssue.getKey(), "admin"));
- assertThat(issueRule.search(new SearchWsRequest().setAssignees(singletonList("admin"))).getIssuesList()).hasSize(1);
+ assertThat(issueRule.search(new SearchRequest().setAssignees(singletonList("admin"))).getIssuesList()).hasSize(1);
projectAnalysis.run();
Issue reloaded = issueRule.getByKey(randomIssue.getKey());
assertThat(reloaded.getAssignee()).isEqualTo("admin");
assertThat(reloaded.getCreationDate()).isEqualTo(randomIssue.getCreationDate());
- response = issueRule.search(new SearchWsRequest().setIssues(singletonList(randomIssue.getKey())).setAdditionalFields(singletonList("users")));
+ response = issueRule.search(new SearchRequest().setIssues(singletonList(randomIssue.getKey())).setAdditionalFields(singletonList("users")));
assertThat(response.getUsers().getUsersList().stream().filter(user -> "admin".equals(user.getLogin())).findFirst()).isPresent();
assertThat(response.getUsers().getUsersList().stream().filter(user -> "Administrator".equals(user.getName())).findFirst()).isPresent();
issuesService.assign(new AssignRequest(randomIssue.getKey(), null));
reloaded = issueRule.getByKey(randomIssue.getKey());
assertThat(reloaded.hasAssignee()).isFalse();
- assertThat(issueRule.search(new SearchWsRequest().setAssignees(singletonList("admin"))).getIssuesList()).isEmpty();
+ assertThat(issueRule.search(new SearchRequest().setAssignees(singletonList("admin"))).getIssuesList()).isEmpty();
}
/**
}
private static List<Issue> searchIssuesBySeverities(String projectKey, String severity) {
- return issueRule.search(new SearchWsRequest().setProjectKeys(singletonList(projectKey)).setSeverities(singletonList(severity))).getIssuesList();
+ return issueRule.search(new SearchRequest().setProjectKeys(singletonList(projectKey)).setSeverities(singletonList(severity))).getIssuesList();
}
}
import org.sonarqube.ws.Issues.BulkChangeWsResponse;
import org.sonarqube.ws.client.issue.BulkChangeRequest;
import org.sonarqube.ws.client.issue.IssuesService;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ProjectAnalysis;
import util.ProjectAnalysisRule;
import util.issue.IssueRule;
}
private static String[] searchIssueKeys(int limit) {
- return getIssueKeys(issueRule.search(new SearchWsRequest()).getIssuesList(), limit);
+ return getIssueKeys(issueRule.search(new SearchRequest()).getIssuesList(), limit);
}
private static String[] getIssueKeys(List<Issues.Issue> issues, int nbIssues) {
import org.junit.Test;
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
private List<Issues.Issue> findIssuesByRuleKey(String ruleKey) {
return adminWsClient.issues().search(
- new SearchWsRequest()
+ new SearchRequest()
.setComponents(singletonList(FILE_KEY))
.setRules(singletonList(ruleKey)))
.getIssuesList();
}
private List<Issues.Issue> findAllIssues() {
- return adminWsClient.issues().search(new SearchWsRequest()).getIssuesList();
+ return adminWsClient.issues().search(new SearchRequest()).getIssuesList();
}
}
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.issue.AssignRequest;
import org.sonarqube.ws.client.issue.BulkChangeRequest;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
clearSmtpMessages();
// Change assignee
- SearchWsResponse issues = tester.wsClient().issues().search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY)));
+ SearchWsResponse issues = tester.wsClient().issues().search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY)));
Issue issue = issues.getIssuesList().get(0);
tester.wsClient().issues().assign(new AssignRequest(issue.getKey(), userWithUserRole.getLogin()));
assertThat(smtpServer.getMessages()).hasSize(privateProject ? 2 : 3);
clearSmtpMessages();
- SearchWsResponse issues = tester.wsClient().issues().search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY)));
+ SearchWsResponse issues = tester.wsClient().issues().search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY)));
Issue issue = issues.getIssuesList().get(0);
// bulk change without notification by default
.setEmail("userWithUserRole@nowhere.com"));
tester.organizations().addMember(organization, userWithUserRole);
tester.wsClient().permissions().addUser(
- new AddUserWsRequest()
+ new AddUserRequest()
.setLogin(userWithUserRole.getLogin())
.setProjectKey(PROJECT_KEY)
.setPermission("user"));
import org.sonar.wsclient.issue.IssueQuery;
import org.sonar.wsclient.issue.Issues;
import org.sonarqube.ws.Common;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static java.util.Arrays.asList;
@Test
public void search_issues_by_types() throws IOException {
- assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("CODE_SMELL"))).getPaging().getTotal()).isEqualTo(142);
- assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("BUG"))).getPaging().getTotal()).isEqualTo(122);
- assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8);
+ assertThat(searchIssues(new SearchRequest().setTypes(singletonList("CODE_SMELL"))).getPaging().getTotal()).isEqualTo(142);
+ assertThat(searchIssues(new SearchRequest().setTypes(singletonList("BUG"))).getPaging().getTotal()).isEqualTo(122);
+ assertThat(searchIssues(new SearchRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8);
}
private List<org.sonarqube.ws.Issues.Issue> searchByRuleKey(String... ruleKey) throws IOException {
- return searchIssues(new SearchWsRequest().setRules(asList(ruleKey))).getIssuesList();
+ return searchIssues(new SearchRequest().setRules(asList(ruleKey))).getIssuesList();
}
- private SearchWsResponse searchIssues(SearchWsRequest request) throws IOException {
+ private SearchWsResponse searchIssues(SearchRequest request) throws IOException {
return newAdminWsClient(ORCHESTRATOR).issues().search(request);
}
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Organizations.Organization;
import org.sonarqube.ws.Users.CreateWsResponse.User;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.project.CreateRequest;
import util.ItUtils;
.build());
analyzeProject(projectKey);
- String issue = tester.wsClient().issues().search(new SearchWsRequest()).getIssues(0).getKey();
+ String issue = tester.wsClient().issues().search(new SearchRequest()).getIssues(0).getKey();
tester.wsClient().issues().setTags(issue, "bla", "blubb");
String[] publicTags = {"bad-practice", "convention", "pitfall"};
private void grantUserPermission(String projectKey, User member) {
tester.wsClient().permissions().addUser(
- new AddUserWsRequest()
+ new AddUserRequest()
.setLogin(member.getLogin())
.setPermission("user")
.setProjectKey(projectKey));
import org.sonarqube.ws.Issues.Issue;
import org.sonarqube.ws.Issues.SearchWsResponse;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
"sonar.projectDate", NEW_DATE_STR,
"sonar.exclusions", "**/*.xoo");
- issues = searchIssues(new SearchWsRequest().setProjectKeys(singletonList("sample"))).getIssuesList();
+ issues = searchIssues(new SearchRequest().setProjectKeys(singletonList("sample"))).getIssuesList();
assertThat(issues).hasSize(1);
assertThat(issues.get(0).getStatus()).isEqualTo("CLOSED");
assertThat(issues.get(0).getResolution()).isEqualTo("FIXED");
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample");
// Only one issue is created
- assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(1);
+ assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(1);
Issue issue = getRandomIssue();
// Re analysis of the same project
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample");
// No new issue should be created
- assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(1);
+ assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(1);
// The issue on module should stay open and be the same from the first analysis
Issue reloadIssue = getIssueByKey(issue.getKey());
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample");
// One issue by module are created
- List<Issue> issues = searchIssues(new SearchWsRequest()).getIssuesList();
+ List<Issue> issues = searchIssues(new SearchRequest()).getIssuesList();
assertThat(issues).hasSize(4);
// Re analysis of the same project
runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample");
// No new issue should be created
- assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(issues.size());
+ assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(issues.size());
// Issues on modules should stay open and be the same from the first analysis
for (Issue issue : issues) {
}
private List<Issue> searchUnresolvedIssuesByComponent(String componentKey) {
- return searchIssues(new SearchWsRequest().setComponentKeys(singletonList(componentKey)).setResolved(false)).getIssuesList();
+ return searchIssues(new SearchRequest().setComponentKeys(singletonList(componentKey)).setResolved(false)).getIssuesList();
}
private static Issue getRandomIssue() {
- return searchIssues(new SearchWsRequest()).getIssues(0);
+ return searchIssues(new SearchRequest()).getIssues(0);
}
private static Issue getIssueByKey(String issueKey) {
- SearchWsResponse search = searchIssues(new SearchWsRequest().setIssues(singletonList(issueKey)));
+ SearchWsResponse search = searchIssues(new SearchRequest().setIssues(singletonList(issueKey)));
assertThat(search.getTotal()).isEqualTo(1);
return search.getIssues(0);
}
- private static SearchWsResponse searchIssues(SearchWsRequest request) {
+ private static SearchWsResponse searchIssues(SearchRequest request) {
return adminClient.issues().search(request);
}
import org.sonarqube.ws.Issues.Issue;
import org.sonarqube.ws.client.issue.DoTransitionRequest;
import org.sonarqube.ws.client.issue.IssuesService;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ProjectAnalysis;
import util.ProjectAnalysisRule;
import util.issue.IssueRule;
*/
@Test
public void issue_is_closed_as_removed_when_rule_is_disabled() throws Exception {
- SearchWsRequest ruleSearchRequest = new SearchWsRequest().setRules(singletonList("xoo:OneIssuePerLine"));
+ SearchRequest ruleSearchRequest = new SearchRequest().setRules(singletonList("xoo:OneIssuePerLine"));
List<Issue> issues = issueRule.search(ruleSearchRequest).getIssuesList();
assertThat(issues).isNotEmpty();
}
private List<String> transitions(String issueKey) {
- Issues.SearchWsResponse response = searchIssues(new SearchWsRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("transitions")));
+ Issues.SearchWsResponse response = searchIssues(new SearchRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("transitions")));
assertThat(response.getTotal()).isEqualTo(1);
return response.getIssues(0).getTransitions().getTransitionsList();
}
- private Issues.SearchWsResponse searchIssues(SearchWsRequest request) {
+ private Issues.SearchWsResponse searchIssues(SearchRequest request) {
return newAdminWsClient(ORCHESTRATOR).issues().search(request);
}
import org.sonarqube.ws.Users.CreateWsResponse.User;
import org.sonarqube.ws.client.issue.AssignRequest;
import org.sonarqube.ws.client.issue.BulkChangeRequest;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import org.sonarqube.ws.client.project.CreateRequest;
import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
import org.sonarqube.qa.util.pageobjects.issues.IssuesPage;
tester.organizations().addMember(org1, user);
provisionAndAnalyseProject(SAMPLE_PROJECT_KEY, org1.getKey());
provisionAndAnalyseProject("sample2", org2.getKey());
- List<String> issues = issueRule.search(new org.sonarqube.ws.client.issue.SearchWsRequest()).getIssuesList().stream().map(Issue::getKey).collect(Collectors.toList());
+ List<String> issues = issueRule.search(new SearchRequest()).getIssuesList().stream().map(Issue::getKey).collect(Collectors.toList());
Issues.BulkChangeWsResponse response = tester.wsClient().issues()
.bulkChange(BulkChangeRequest.builder().setIssues(issues).setAssign(user.getLogin()).build());
assertThat(response.getIgnored()).isGreaterThan(0);
- assertThat(issueRule.search(new SearchWsRequest().setProjectKeys(singletonList("sample"))).getIssuesList()).extracting(Issue::getAssignee)
+ assertThat(issueRule.search(new SearchRequest().setProjectKeys(singletonList("sample"))).getIssuesList()).extracting(Issue::getAssignee)
.containsOnly(user.getLogin());
- assertThat(issueRule.search(new SearchWsRequest().setProjectKeys(singletonList("sample2"))).getIssuesList()).extracting(Issue::hasAssignee)
+ assertThat(issueRule.search(new SearchRequest().setProjectKeys(singletonList("sample2"))).getIssuesList()).extracting(Issue::hasAssignee)
.containsOnly(false);
}
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.Components;
import org.sonarqube.ws.Measures;
-import org.sonarqube.ws.client.component.TreeWsRequest;
+import org.sonarqube.ws.client.component.TreeRequest;
import org.sonarqube.ws.client.issue.IssuesService;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
import org.sonarqube.ws.client.measure.MeasuresService;
import static java.util.Arrays.asList;
public void call_issues_ws() {
// all issues
IssuesService issuesService = tester.wsClient().issues();
- Issues.SearchWsResponse response = issuesService.search(new SearchWsRequest());
+ Issues.SearchWsResponse response = issuesService.search(new SearchRequest());
assertThat(response.getIssuesCount()).isGreaterThan(0);
// project issues
- response = issuesService.search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY)));
+ response = issuesService.search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY)));
assertThat(response.getIssuesCount()).isGreaterThan(0);
}
@Test
public void call_components_ws() {
// files in project
- Components.TreeWsResponse tree = tester.wsClient().components().tree(new TreeWsRequest()
+ Components.TreeWsResponse tree = tester.wsClient().components().tree(new TreeRequest()
.setBaseComponentKey(PROJECT_KEY)
.setQualifiers(singletonList("FIL")));
assertThat(tree.getComponentsCount()).isEqualTo(4);
public void call_measures_ws() {
// project measures
MeasuresService measuresService = tester.wsClient().measures();
- Measures.ComponentWsResponse component = measuresService.component(new ComponentWsRequest()
+ Measures.ComponentWsResponse component = measuresService.component(new ComponentRequest()
.setComponentKey(PROJECT_KEY)
.setMetricKeys(asList("lines", "ncloc", "files")));
assertThat(component.getComponent().getMeasuresCount()).isEqualTo(3);
// file measures
- Measures.ComponentTreeWsResponse tree = measuresService.componentTree(new ComponentTreeWsRequest()
+ Measures.ComponentTreeWsResponse tree = measuresService.componentTree(new ComponentTreeRequest()
.setBaseComponentKey(PROJECT_KEY)
.setQualifiers(singletonList("FIL"))
.setMetricKeys(asList("lines", "ncloc")));
import org.sonarqube.ws.Measures;
import org.sonarqube.ws.Measures.ComponentTreeWsResponse;
import org.sonarqube.ws.Measures.ComponentWsResponse;
-import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
+import org.sonarqube.ws.client.measure.ComponentTreeRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Arrays.asList;
public void component_tree() {
scanXooSample();
- ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeWsRequest()
+ ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeRequest()
.setComponent("sample")
.setMetricKeys(singletonList("ncloc"))
.setAdditionalFields(asList("metrics", "periods")));
}
private void verifyComponentTreeWithChildren(String baseComponentKey, String... childKeys) {
- ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeWsRequest()
+ ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeRequest()
.setComponent(baseComponentKey)
.setMetricKeys(singletonList("ncloc"))
.setStrategy("children"));
public void component() {
scanXooSample();
- ComponentWsResponse response = tester.wsClient().measures().component(new ComponentWsRequest()
+ ComponentWsResponse response = tester.wsClient().measures().component(new ComponentRequest()
.setComponent("sample")
.setMetricKeys(singletonList("ncloc"))
.setAdditionalFields(newArrayList("metrics", "periods")));
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsResponse;
import org.sonarqube.ws.client.ce.TaskRequest;
-import org.sonarqube.ws.client.organization.UpdateProjectVisibilityWsRequest;
+import org.sonarqube.ws.client.organization.UpdateProjectVisibilityRequest;
import org.sonarqube.ws.client.project.CreateRequest;
import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
import util.ItUtils;
public void does_not_fail_to_update_default_projects_visibility_to_private() {
tester.settings().setGlobalSettings("sonar.billing.preventUpdatingProjectsVisibilityToPrivate", "false");
- tester.wsClient().organizations().updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder()
+ tester.wsClient().organizations().updateProjectVisibility(UpdateProjectVisibilityRequest.builder()
.setOrganization(organization.getKey())
.setProjectVisibility("private")
.build());
expectHttpError(400,
format("Organization %s cannot use private project", organization.getKey()),
() -> tester.wsClient().organizations()
- .updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder().setOrganization(organization.getKey()).setProjectVisibility("private").build()));
+ .updateProjectVisibility(UpdateProjectVisibilityRequest.builder().setOrganization(organization.getKey()).setProjectVisibility("private").build()));
}
@Test
import org.sonarqube.ws.Organizations.Organization;
import org.sonarqube.ws.Users.CreateWsResponse.User;
import org.sonarqube.ws.client.HttpException;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
public class OrganizationMembershipTest {
User user = tester.users().generate();
addMembership(organization, user);
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
tester.organizations().assertThatMemberOf(organization, user);
removeMembership(organization, user);
User user = tester.users().generate();
addMembership(organization, user);
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
tester.organizations().assertThatMemberOf(organization, user);
// Admin is the creator of the organization so he was granted with admin permission
tester.wsClient().organizations().removeMember(organization.getKey(), "admin");
import org.sonarqube.ws.Users;
import org.sonarqube.ws.Users.CreateWsResponse.User;
import org.sonarqube.ws.client.component.ComponentsService;
-import org.sonarqube.ws.client.organization.CreateWsRequest;
+import org.sonarqube.ws.client.organization.CreateRequest;
import org.sonarqube.ws.client.organization.OrganizationService;
-import org.sonarqube.ws.client.organization.SearchWsRequest;
-import org.sonarqube.ws.client.organization.UpdateWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.organization.SearchRequest;
+import org.sonarqube.ws.client.organization.UpdateRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.permission.PermissionsService;
import org.sonarqube.ws.client.roots.SetRootRequest;
import org.sonarqube.ws.client.roots.UnsetRootRequest;
@Test
public void default_organization_should_exist() {
- Organization defaultOrg = tester.organizations().service().search(SearchWsRequest.builder().build())
+ Organization defaultOrg = tester.organizations().service().search(SearchRequest.builder().build())
.getOrganizationsList()
.stream()
.filter(Organization::getGuarded)
assertThatBuiltInQualityProfilesExist(org);
// update by key
- service.update(new UpdateWsRequest.Builder()
+ service.update(new UpdateRequest.Builder()
.setKey(org.getKey())
.setName("new name")
.setDescription("new description")
verifyOrganization(org, "new name", "new description", "new url", "new avatar url");
// remove optional fields
- service.update(new UpdateWsRequest.Builder()
+ service.update(new UpdateRequest.Builder()
.setKey(org.getKey())
.setName("new name 2")
.setDescription("")
assertThatQualityProfilesDoNotExist(org);
// create again
- service.create(new CreateWsRequest.Builder()
+ service.create(new CreateRequest.Builder()
.setName(NAME)
.setKey(org.getKey())
.build())
// create organization without key
String name = "Foo Company to keyize";
String expectedKey = "foo-company-to-keyize";
- Organization createdOrganization = tester.organizations().service().create(new CreateWsRequest.Builder()
+ Organization createdOrganization = tester.organizations().service().create(new CreateRequest.Builder()
.setName(name)
.build())
.getOrganization();
OrganizationTester anonymousTester = tester.asAnonymous().organizations();
expectForbiddenError(() -> anonymousTester.generate());
- expectUnauthorizedError(() -> anonymousTester.service().update(new UpdateWsRequest.Builder().setKey(org.getKey()).setName("new name").build()));
+ expectUnauthorizedError(() -> anonymousTester.service().update(new UpdateRequest.Builder().setKey(org.getKey()).setName("new name").build()));
expectUnauthorizedError(() -> anonymousTester.service().delete(org.getKey()));
}
OrganizationTester userTester = tester.as(user.getLogin()).organizations();
expectForbiddenError(() -> userTester.generate());
- expectForbiddenError(() -> userTester.service().update(new UpdateWsRequest.Builder().setKey(org.getKey()).setName("new name").build()));
+ expectForbiddenError(() -> userTester.service().update(new UpdateRequest.Builder().setKey(org.getKey()).setName("new name").build()));
expectForbiddenError(() -> userTester.service().delete(org.getKey()));
}
private void addPermissionsToUser(String orgKeyAndName, String login, String permission, String... otherPermissions) {
PermissionsService permissionsService = tester.wsClient().permissions();
- permissionsService.addUser(new AddUserWsRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(permission));
+ permissionsService.addUser(new AddUserRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(permission));
for (String otherPermission : otherPermissions) {
- permissionsService.addUser(new AddUserWsRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(otherPermission));
+ permissionsService.addUser(new AddUserRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(otherPermission));
}
}
assertThat(organization.getKey()).isNotEmpty();
assertThat(organization.getGuarded()).isFalse();
- List<Organization> reloadedOrgs = tester.organizations().service().search(SearchWsRequest.builder().build()).getOrganizationsList();
+ List<Organization> reloadedOrgs = tester.organizations().service().search(SearchRequest.builder().build()).getOrganizationsList();
assertThat(reloadedOrgs)
.filteredOn(o -> o.getKey().equals(organization.getKey()))
.hasSize(1);
private Components.SearchWsResponse searchSampleProject(String organizationKey, ComponentsService componentsService) {
return componentsService
- .search(new org.sonarqube.ws.client.component.SearchWsRequest()
+ .search(new org.sonarqube.ws.client.component.SearchRequest()
.setOrganization(organizationKey)
.setQualifiers(singletonList("TRK"))
.setQuery("sample"));
}
private void assertThatOrganizationDoesNotExit(Organization org) {
- SearchWsRequest request = new SearchWsRequest.Builder().setOrganizations(org.getKey()).build();
+ SearchRequest request = new SearchRequest.Builder().setOrganizations(org.getKey()).build();
assertThat(tester.organizations().service().search(request).getOrganizationsList()).isEmpty();
}
private void verifyOrganization(Organization createdOrganization, String name, String description, String url,
String avatarUrl) {
- SearchWsRequest request = new SearchWsRequest.Builder().setOrganizations(createdOrganization.getKey()).build();
+ SearchRequest request = new SearchRequest.Builder().setOrganizations(createdOrganization.getKey()).build();
List<Organization> result = tester.organizations().service().search(request).getOrganizationsList();
assertThat(result).hasSize(1);
Organization searchedOrganization = result.get(0);
}
private void assertThatBuiltInQualityProfilesExist(Organization org) {
- org.sonarqube.ws.client.qualityprofile.SearchWsRequest profilesRequest = new org.sonarqube.ws.client.qualityprofile.SearchWsRequest()
+ org.sonarqube.ws.client.qualityprofile.SearchRequest profilesRequest = new org.sonarqube.ws.client.qualityprofile.SearchRequest()
.setOrganizationKey(org.getKey());
Qualityprofiles.SearchWsResponse response = tester.wsClient().qualityProfiles().search(profilesRequest);
assertThat(response.getProfilesCount()).isGreaterThan(0);
private void assertThatQualityProfilesDoNotExist(Organization org) {
expectNotFoundError(() -> tester.wsClient().qualityProfiles().search(
- new org.sonarqube.ws.client.qualityprofile.SearchWsRequest().setOrganizationKey(org.getKey())));
+ new org.sonarqube.ws.client.qualityprofile.SearchRequest().setOrganizationKey(org.getKey())));
}
}
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Organizations;
import org.sonarqube.ws.Users;
-import org.sonarqube.ws.client.organization.SearchWsRequest;
+import org.sonarqube.ws.client.organization.SearchRequest;
import static org.assertj.core.api.Assertions.assertThat;
public void personal_organizations_are_created_for_new_users() {
Users.CreateWsResponse.User user = tester.users().generate();
- List<Organizations.Organization> existing = tester.wsClient().organizations().search(SearchWsRequest.builder().build()).getOrganizationsList();
+ List<Organizations.Organization> existing = tester.wsClient().organizations().search(SearchRequest.builder().build()).getOrganizationsList();
assertThat(existing)
.filteredOn(Organizations.Organization::getGuarded)
.filteredOn(o -> o.getKey().equals(user.getLogin()))
import org.sonarqube.ws.client.HttpConnector;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.WsClientFactories;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
import static java.lang.Double.parseDouble;
import static java.util.Arrays.asList;
}
private Map<String, Double> getMeasures(String key) {
- return newWsClient().measures().component(new ComponentWsRequest()
+ return newWsClient().measures().component(new ComponentRequest()
.setComponentKey(key)
.setMetricKeys(asList("duplicated_lines", "duplicated_blocks", "duplicated_files", "duplicated_lines_density")))
.getComponent().getMeasuresList()
import org.sonarqube.ws.Organizations;
import org.sonarqube.ws.Projects.CreateWsResponse;
import org.sonarqube.ws.Projects.SearchWsResponse.Component;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static util.ItUtils.runProjectAnalysis;
analyzeProject(analyzedProject.getKey(), organization.getKey());
- tester.wsClient().projects().bulkDelete(SearchWsRequest.builder()
+ tester.wsClient().projects().bulkDelete(SearchRequest.builder()
.setOrganization(organization.getKey())
.setQuery("FIRST-PROVISIONED")
.setOnProvisionedOnly(true).build());
- List<Component> projects = tester.wsClient().projects().search(SearchWsRequest.builder().setOrganization(organization.getKey()).build()).getComponentsList();
+ List<Component> projects = tester.wsClient().projects().search(SearchRequest.builder().setOrganization(organization.getKey()).build()).getComponentsList();
assertThat(projects).extracting(Component::getKey)
.containsExactlyInAnyOrder(analyzedProject.getKey(), secondProvisionedProject.getKey())
.doesNotContain(firstProvisionedProject.getKey());
public void delete_more_than_50_projects_at_the_same_time() {
Organizations.Organization organization = tester.organizations().generate();
IntStream.range(0, 60).forEach(i -> tester.projects().provision(organization));
- SearchWsRequest request = SearchWsRequest.builder().setOrganization(organization.getKey()).build();
+ SearchRequest request = SearchRequest.builder().setOrganization(organization.getKey()).build();
assertThat(tester.wsClient().projects().search(request).getPaging().getTotal()).isEqualTo(60);
tester.wsClient().projects().bulkDelete(request);
import org.sonarqube.ws.client.component.SearchProjectsRequest;
import org.sonarqube.ws.client.project.CreateRequest;
import org.sonarqube.ws.client.project.DeleteRequest;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
}
private void bulkDeleteProjects(Organizations.Organization organization, Project... projects) {
- SearchWsRequest request = SearchWsRequest.builder()
+ SearchRequest request = SearchRequest.builder()
.setOrganization(organization.getKey())
.setProjects(Arrays.stream(projects).map(Project::getKey).collect(Collectors.toList()))
.build();
*/
private boolean isInProjectsSearch(Organizations.Organization organization, String name) {
Projects.SearchWsResponse response = tester.wsClient().projects().search(
- SearchWsRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build());
+ SearchRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build());
return response.getComponentsCount() > 0;
}
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsResponse;
import org.sonarqube.ws.client.component.SearchProjectsRequest;
-import org.sonarqube.ws.client.component.ShowWsRequest;
-import org.sonarqube.ws.client.project.BulkUpdateKeyWsRequest;
+import org.sonarqube.ws.client.component.ShowRequest;
+import org.sonarqube.ws.client.project.BulkUpdateKeyRequest;
import org.sonarqube.ws.client.project.CreateRequest;
-import org.sonarqube.ws.client.project.UpdateKeyWsRequest;
+import org.sonarqube.ws.client.project.UpdateKeyRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
public void update_key() {
analyzeXooSample();
String newProjectKey = "another_project_key";
- Components.Component project = tester.wsClient().components().show(new ShowWsRequest().setKey(PROJECT_KEY)).getComponent();
+ Components.Component project = tester.wsClient().components().show(new ShowRequest().setKey(PROJECT_KEY)).getComponent();
assertThat(project.getKey()).isEqualTo(PROJECT_KEY);
- tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder()
+ tester.wsClient().projects().updateKey(UpdateKeyRequest.builder()
.setKey(PROJECT_KEY)
.setNewKey(newProjectKey)
.build());
- assertThat(tester.wsClient().components().show(new ShowWsRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey);
+ assertThat(tester.wsClient().components().show(new ShowRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey);
}
@Test
public void bulk_update_key() {
analyzeXooSample();
String newProjectKey = "another_project_key";
- Components.Component project = tester.wsClient().components().show(new ShowWsRequest().setKey(PROJECT_KEY)).getComponent();
+ Components.Component project = tester.wsClient().components().show(new ShowRequest().setKey(PROJECT_KEY)).getComponent();
assertThat(project.getKey()).isEqualTo(PROJECT_KEY);
- Projects.BulkUpdateKeyWsResponse result = tester.wsClient().projects().bulkUpdateKey(BulkUpdateKeyWsRequest.builder()
+ Projects.BulkUpdateKeyWsResponse result = tester.wsClient().projects().bulkUpdateKey(BulkUpdateKeyRequest.builder()
.setKey(PROJECT_KEY)
.setFrom(PROJECT_KEY)
.setTo(newProjectKey)
.build());
- assertThat(tester.wsClient().components().show(new ShowWsRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey);
+ assertThat(tester.wsClient().components().show(new ShowRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey);
assertThat(result.getKeysCount()).isEqualTo(1);
assertThat(result.getKeys(0))
.extracting(Projects.BulkUpdateKeyWsResponse.Key::getKey, Projects.BulkUpdateKeyWsResponse.Key::getNewKey, Projects.BulkUpdateKeyWsResponse.Key::getDuplicate)
}
private void updateKey(Projects.CreateWsResponse.Project project, String newKey) {
- tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder().setKey(project.getKey()).setNewKey(newKey).build());
+ tester.wsClient().projects().updateKey(UpdateKeyRequest.builder().setKey(project.getKey()).setNewKey(newKey).build());
}
private void updateKey(String initialKey, String newKey) {
- tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder().setKey(initialKey).setNewKey(newKey).build());
+ tester.wsClient().projects().updateKey(UpdateKeyRequest.builder().setKey(initialKey).setNewKey(newKey).build());
}
private Projects.CreateWsResponse.Project createProject(Organizations.Organization organization, String key, String name) {
import org.sonarqube.ws.client.WsResponse;
import org.sonarqube.ws.client.component.SearchProjectsRequest;
import org.sonarqube.ws.client.project.CreateRequest;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import util.ItUtils;
import static java.util.Collections.singletonList;
*/
private boolean isInProjectsSearch(Organizations.Organization organization, String name) {
Projects.SearchWsResponse response = tester.wsClient().projects().search(
- SearchWsRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build());
+ SearchRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build());
return response.getComponentsCount() > 0;
}
import org.sonarqube.ws.Projects.SearchWsResponse;
import org.sonarqube.ws.Projects.SearchWsResponse.Component;
import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.project.SearchWsRequest;
+import org.sonarqube.ws.client.project.SearchRequest;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
analyzeProject(oldProject.getKey(), moreThanOneYearAgo, organization.getKey());
analyzeProject(recentProject.getKey(), now, organization.getKey());
- SearchWsResponse result = tester.wsClient().projects().search(SearchWsRequest.builder()
+ SearchWsResponse result = tester.wsClient().projects().search(SearchRequest.builder()
.setOrganization(organization.getKey())
.setQualifiers(singletonList("TRK"))
.setAnalyzedBefore(formatDate(oneYearAgo)).build());
analyzeProject(upperCaseProject.getKey(), organization.getKey());
analyzeProject(anotherProject.getKey(), organization.getKey());
- SearchWsResponse result = tester.wsClient().projects().search(SearchWsRequest.builder()
+ SearchWsResponse result = tester.wsClient().projects().search(SearchRequest.builder()
.setOrganization(organization.getKey())
.setQualifiers(singletonList("TRK"))
.setQuery("JeCt-K")
String result = tester.wsClient().wsConnector().call(new GetRequest("api/projects/provisioned")
.setParam("organization", organization.getKey()))
.failIfNotSuccessful().content();
- SearchWsResponse searchResult = tester.wsClient().projects().search(SearchWsRequest.builder()
+ SearchWsResponse searchResult = tester.wsClient().projects().search(SearchRequest.builder()
.setQualifiers(singletonList("TRK"))
.setOrganization(organization.getKey())
.setOnProvisionedOnly(true).build());
import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage;
import org.sonarqube.ws.Components;
import org.sonarqube.ws.client.component.SearchProjectsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
+import org.sonarqube.ws.client.permission.RemoveGroupRequest;
import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
import static org.assertj.core.api.Assertions.assertThat;
orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")).setProperties("sonar.projectKey", "sample2"));
tester.wsClient().projects().updateVisibility(UpdateVisibilityRequest.builder().setProject("sample2").setVisibility("private").build());
// Remove 'Admin' permission for admin group on project 2 -> No one can access or admin this project, expect System Admin
- tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setProjectKey("sample2").setGroupName("sonar-administrators").setPermission("admin"));
+ tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setProjectKey("sample2").setGroupName("sonar-administrators").setPermission("admin"));
tester.openBrowser().logIn().submitCredentials(adminUser)
.openProjectsManagement("default-organization")
import org.sonarqube.qa.util.pageobjects.QualityGatePage;
import org.sonarqube.ws.Organizations;
import org.sonarqube.ws.Users;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import util.issue.IssueRule;
import static com.codeborne.selenide.Selenide.$;
organization = tester.organizations().generate();
gateAdmin = tester.users().generate();
tester.organizations().addMember(tester.organizations().getDefaultOrganization(), gateAdmin);
- tester.wsClient().permissions().addUser(new org.sonarqube.ws.client.permission.AddUserWsRequest().setLogin(gateAdmin.getLogin()).setPermission("gateadmin"));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(gateAdmin.getLogin()).setPermission("gateadmin"));
user = tester.users().generate();
tester.organizations().addMember(organization, user);
restoreProfile(orchestrator, getClass().getResource("/issue/with-many-rules.xml"), organization.getKey());
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.qualitygates.CreateConditionRequest;
import org.sonarqube.ws.client.qualitygates.CreateRequest;
import org.sonarqube.ws.client.qualitygates.ProjectStatusRequest;
// user is quality gate admin of default organization
Organization organization = tester.organizations().getDefaultOrganization();
Users.CreateWsResponse.User user = tester.users().generateMember(organization);
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("gateadmin").setOrganization(organization.getKey()));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("gateadmin").setOrganization(organization.getKey()));
TesterSession qGateAdminTester = tester.as(user.getLogin());
QualitygatesService qGateService = qGateAdminTester.qGates().service();
// perform administration operations
import org.junit.Test;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Issues;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample"))
.setProperties("sonar.oneIssuePerFile.effortToFix", "10"));
- Issues.Issue firstIssue = tester.wsClient().issues().search(new SearchWsRequest()).getIssues(0);
+ Issues.Issue firstIssue = tester.wsClient().issues().search(new SearchRequest()).getIssues(0);
List<Issues.ChangelogWsResponse.Changelog> changes = changelog(firstIssue.getKey()).getChangelogList();
assertThat(changes).hasSize(1);
import org.junit.Test;
import org.sonarqube.qa.util.Tester;
import org.sonarqube.ws.Issues;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")));
// All the issues should have a technical debt
- List<Issues.Issue> issues = tester.wsClient().issues().search(new SearchWsRequest()).getIssuesList();
+ List<Issues.Issue> issues = tester.wsClient().issues().search(new SearchRequest()).getIssuesList();
assertThat(issues).isNotEmpty();
for (Issues.Issue issue : issues) {
assertThat(issue.getDebt()).isEqualTo("1min");
import org.sonarqube.ws.Users;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddGroupRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
import org.sonarqube.ws.client.qualityprofile.CreateRequest;
import org.subethamail.wiser.Wiser;
userRule = UserRule.from(orchestrator);
Users.CreateWsResponse.User profileAdmin1 = userRule.generate();
WsClient wsClient = ItUtils.newAdminWsClient(orchestrator);
- wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
+ wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
orchestrator.restartServer();
// Create a quality profile administrator (user having direct permission)
Users.CreateWsResponse.User profileAdmin1 = userRule.generate();
WsClient wsClient = ItUtils.newAdminWsClient(orchestrator);
- wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
+ wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
// Create a quality profile administrator (user having permission from a group)
Users.CreateWsResponse.User profileAdmin2 = userRule.generate();
String groupName = randomAlphanumeric(20);
wsClient.wsConnector().call(new PostRequest("api/user_groups/create").setParam("name", groupName)).failIfNotSuccessful();
- wsClient.permissions().addGroup(new AddGroupWsRequest().setPermission("profileadmin").setGroupName(groupName));
+ wsClient.permissions().addGroup(new AddGroupRequest().setPermission("profileadmin").setGroupName(groupName));
wsClient.wsConnector().call(new PostRequest("api/user_groups/add_user").setParam("name", groupName).setParam("login", profileAdmin2.getLogin())).failIfNotSuccessful();
// Create a user not being quality profile administrator
Users.CreateWsResponse.User noProfileAdmin = userRule.generate();
userRule = UserRule.from(orchestrator);
Users.CreateWsResponse.User profileAdmin1 = userRule.generate();
WsClient wsClient = ItUtils.newAdminWsClient(orchestrator);
- wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
+ wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin"));
// uninstall plugin V1
wsClient.wsConnector().call(new PostRequest("api/plugins/uninstall").setParam("key", "foo")).failIfNotSuccessful();
import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
import org.sonarqube.ws.client.qualityprofile.CopyRequest;
import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
-import org.sonarqube.ws.client.qualityprofile.SearchWsRequest;
+import org.sonarqube.ws.client.qualityprofile.SearchRequest;
import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest;
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void built_in_profiles_are_available_in_new_organization() {
Organization org = tester.organizations().generate();
- SearchWsResponse result = tester.qProfiles().service().search(new SearchWsRequest().setOrganizationKey(org.getKey()));
+ SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey(org.getKey()));
assertThat(result.getProfilesList())
.extracting(QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault)
@Test
public void built_in_profiles_are_available_in_default_organization() {
- SearchWsResponse result = tester.qProfiles().service().search(new SearchWsRequest().setOrganizationKey("default-organization"));
+ SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey("default-organization"));
assertThat(result.getProfilesList())
.extracting(QualityProfile::getOrganization, QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault)
}
private QualityProfile getProfile(Organization organization, Predicate<QualityProfile> filter) {
- return tester.qProfiles().service().search(new SearchWsRequest()
+ return tester.qProfiles().service().search(new SearchRequest()
.setOrganizationKey(organization.getKey())).getProfilesList()
.stream()
.filter(filter)
import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
import org.sonarqube.ws.client.qualityprofile.CopyRequest;
import org.sonarqube.ws.client.qualityprofile.CreateRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchWsRequest;
+import org.sonarqube.ws.client.qualityprofile.SearchRequest;
import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest;
import util.ItUtils;
tester.organizations().service().delete(org.getKey());
- expectMissingError(() -> tester.qProfiles().service().search(new SearchWsRequest()
+ expectMissingError(() -> tester.qProfiles().service().search(new SearchRequest()
.setOrganizationKey(org.getKey())));
- tester.qProfiles().service().search(new SearchWsRequest()).getProfilesList()
+ tester.qProfiles().service().search(new SearchRequest()).getProfilesList()
.forEach(p -> {
assertThat(p.getOrganization()).isNotEqualTo(org.getKey());
assertThat(p.getKey()).isNotIn(parentProfile.getKey(), copyResponse.getKey(), inheritedProfile1.getKey(), inheritedProfile2.getKey());
}
private Qualityprofiles.SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<Qualityprofiles.SearchWsResponse.QualityProfile> filter) {
- return tester.qProfiles().service().search(new SearchWsRequest()
+ return tester.qProfiles().service().search(new SearchRequest()
.setOrganizationKey(organization.getKey())).getProfilesList()
.stream()
.filter(filter)
import org.sonarqube.ws.UserGroups;
import org.sonarqube.ws.Users.CreateWsResponse.User;
import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.qualityprofile.AddGroupRequest;
-import org.sonarqube.ws.client.qualityprofile.AddUserRequest;
import org.sonarqube.ws.client.qualityprofile.RemoveGroupRequest;
import org.sonarqube.ws.client.qualityprofile.RemoveUserRequest;
import org.sonarqube.ws.client.qualityprofile.SearchGroupsRequest;
import org.sonarqube.ws.client.qualityprofile.SearchUsersRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchWsRequest;
+import org.sonarqube.ws.client.qualityprofile.SearchRequest;
import org.sonarqube.ws.client.qualityprofile.ShowRequest;
import static org.assertj.core.api.Assertions.assertThat;
CreateWsResponse.QualityProfile xooProfile3 = tester.qProfiles().createXooProfile(organization);
SearchWsResponse result = tester.as(user.getLogin())
- .qProfiles().service().search(new SearchWsRequest().setOrganizationKey(organization.getKey()));
+ .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey()));
assertThat(result.getActions().getCreate()).isFalse();
assertThat(result.getProfilesList())
.extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault())
Organization organization = tester.organizations().generate();
User user = tester.users().generateMember(organization);
CreateWsResponse.QualityProfile xooProfile = tester.qProfiles().createXooProfile(organization);
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setOrganization(organization.getKey()).setLogin(user.getLogin()).setPermission("profileadmin"));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setOrganization(organization.getKey()).setLogin(user.getLogin()).setPermission("profileadmin"));
SearchWsResponse result = tester.as(user.getLogin())
- .qProfiles().service().search(new SearchWsRequest().setOrganizationKey(organization.getKey()));
+ .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey()));
assertThat(result.getActions().getCreate()).isTrue();
assertThat(result.getProfilesList())
.extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault())
}
private void addUserPermission(Organization organization, User user, CreateWsResponse.QualityProfile qProfile) {
- tester.qProfiles().service().addUser(AddUserRequest.builder()
+ tester.qProfiles().service().addUser(org.sonarqube.ws.client.qualityprofile.AddUserRequest.builder()
.setOrganization(organization.getKey())
.setQualityProfile(qProfile.getName())
.setLanguage(qProfile.getLanguage())
}
private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
- return tester.qProfiles().service().search(new SearchWsRequest()
+ return tester.qProfiles().service().search(new SearchRequest()
.setOrganizationKey(organization.getKey())).getProfilesList()
.stream()
.filter(filter)
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.qualityprofile.ChangelogWsRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchWsRequest;
+import org.sonarqube.ws.client.qualityprofile.ChangelogRequest;
+import org.sonarqube.ws.client.qualityprofile.SearchRequest;
import org.sonarqube.ws.client.qualityprofile.ShowRequest;
import static org.assertj.core.api.Assertions.assertThat;
Organization org = tester.organizations().generate();
CreateWsResponse.QualityProfile profile = tester.qProfiles().createXooProfile(org);
- String changelog = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder()
+ String changelog = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder()
.setOrganization(org.getKey())
.setLanguage(profile.getLanguage())
.setQualityProfile(profile.getName())
tester.qProfiles().activateRule(profile, RULE_ONE_BUG_PER_LINE);
tester.qProfiles().activateRule(profile, RULE_ONE_ISSUE_PER_LINE);
- String changelog2 = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder()
+ String changelog2 = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder()
.setOrganization(org.getKey())
.setLanguage(profile.getLanguage())
.setQualityProfile(profile.getName())
.build());
JSONAssert.assertEquals(EXPECTED_CHANGELOG, changelog2, JSONCompareMode.LENIENT);
- String changelog3 = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder()
+ String changelog3 = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder()
.setOrganization(org.getKey())
.setLanguage(profile.getLanguage())
.setQualityProfile(profile.getName())
}
private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
- return tester.qProfiles().service().search(new SearchWsRequest()
+ return tester.qProfiles().service().search(new SearchRequest()
.setOrganizationKey(organization.getKey())).getProfilesList()
.stream()
.filter(filter)
}
private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
- return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofile.SearchWsRequest()
+ return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofile.SearchRequest()
.setOrganizationKey(organization.getKey())).getProfilesList()
.stream()
.filter(filter)
import org.junit.Test;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import util.ItUtils;
import static java.lang.String.format;
private void generateSqlAndEsLogsInWebAndCe() {
orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")));
- ItUtils.newAdminWsClient(orchestrator).issues().search(new SearchWsRequest()
+ ItUtils.newAdminWsClient(orchestrator).issues().search(new SearchRequest()
.setProjectKeys(Collections.singletonList("sample")));
}
import org.sonarqube.ws.System;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import util.ItUtils;
import static org.assertj.core.api.Assertions.assertThat;
private void createSystemAdministrator(String login, String password) {
WsClient wsClient = newAdminWsClient(orchestrator);
createNonSystemAdministrator(wsClient, login, password);
- wsClient.permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission("admin"));
+ wsClient.permissions().addUser(new AddUserRequest().setLogin(login).setPermission("admin"));
}
private void createNonSystemAdministrator(String login, String password) {
import org.sonarqube.tests.Category1Suite;
import org.sonarqube.ws.Settings;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
+import org.sonarqube.ws.client.permission.AddGroupRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
+import org.sonarqube.ws.client.permission.RemoveGroupRequest;
import org.sonarqube.ws.client.settings.ResetRequest;
import org.sonarqube.ws.client.settings.SetRequest;
import org.sonarqube.ws.client.settings.SettingsService;
userRule.createUser("scanner-user", "scanner-user");
adminWsClient = newAdminWsClient(orchestrator);
// Remove 'Execute Analysis' permission from anyone
- adminWsClient.permissions().removeGroup(new RemoveGroupWsRequest().setGroupName("anyone").setPermission("scan"));
+ adminWsClient.permissions().removeGroup(new RemoveGroupRequest().setGroupName("anyone").setPermission("scan"));
// Anonymous user, without 'Execute Analysis' permission
anonymousSettingsService = newWsClient(orchestrator).settings();
userSettingsService = newUserWsClient(orchestrator, "setting-user", "setting-user").settings();
// User with 'Execute Analysis' permission
- adminWsClient.permissions().addUser(new AddUserWsRequest().setLogin("scanner-user").setPermission("scan"));
+ adminWsClient.permissions().addUser(new AddUserRequest().setLogin("scanner-user").setPermission("scan"));
scanSettingsService = newUserWsClient(orchestrator, "scanner-user", "scanner-user").settings();
// User with 'Administer System' permission but without 'Execute Analysis' permission
public static void tearDown() throws Exception {
userRule.deactivateUsers("setting-user", "scanner-user");
// Restore 'Execute Analysis' permission to anyone
- adminWsClient.permissions().addGroup(new AddGroupWsRequest().setGroupName("anyone").setPermission("scan"));
+ adminWsClient.permissions().addGroup(new AddGroupRequest().setGroupName("anyone").setPermission("scan"));
}
@After
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.WsClientFactories;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
import static com.codeborne.selenide.Condition.hasText;
import static com.codeborne.selenide.Selenide.$;
}
private int countFiles(String key) {
- Measure measure = newWsClient(orchestrator).measures().component(new ComponentWsRequest().setComponentKey(key).setMetricKeys(Collections.singletonList("files")))
+ Measure measure = newWsClient(orchestrator).measures().component(new ComponentRequest().setComponentKey(key).setMetricKeys(Collections.singletonList("files")))
.getComponent().getMeasures(0);
return parseInt(measure.getValue());
}
import org.sonarqube.ws.Users.SearchWsResponse.User;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.user.CreateRequest;
import util.selenium.Selenese;
enablePlugin();
tester.users().generate(u -> u.setLogin(USER_LOGIN));
// Give user global admin permission as we want to go to a page where authentication is required
- tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(USER_LOGIN).setPermission("admin"));
+ tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(USER_LOGIN).setPermission("admin"));
Navigation nav = tester.openBrowser();
// Try to go to the settings page
import org.sonarqube.ws.client.HttpConnector;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.WsClientFactories;
-import org.sonarqube.ws.client.component.ShowWsRequest;
-import org.sonarqube.ws.client.measure.ComponentWsRequest;
-import org.sonarqube.ws.client.qualityprofile.RestoreWsRequest;
+import org.sonarqube.ws.client.component.ShowRequest;
+import org.sonarqube.ws.client.measure.ComponentRequest;
+import org.sonarqube.ws.client.qualityprofile.RestoreRequest;
import org.sonarqube.ws.client.settings.ResetRequest;
import org.sonarqube.ws.client.settings.SetRequest;
}
private static Stream<Measure> getStreamMeasures(Orchestrator orchestrator, String componentKey, String... metricKeys) {
- return newWsClient(orchestrator).measures().component(new ComponentWsRequest()
+ return newWsClient(orchestrator).measures().component(new ComponentRequest()
.setComponent(componentKey)
.setMetricKeys(asList(metricKeys)))
.getComponent().getMeasuresList()
@CheckForNull
public static Measure getMeasureWithVariation(Orchestrator orchestrator, String componentKey, String metricKey) {
- Measures.ComponentWsResponse response = newWsClient(orchestrator).measures().component(new ComponentWsRequest()
+ Measures.ComponentWsResponse response = newWsClient(orchestrator).measures().component(new ComponentRequest()
.setComponentKey(componentKey)
.setMetricKeys(singletonList(metricKey))
.setAdditionalFields(singletonList("periods")));
@CheckForNull
public static Map<String, Measure> getMeasuresWithVariationsByMetricKey(Orchestrator orchestrator, String componentKey, String... metricKeys) {
- return newWsClient(orchestrator).measures().component(new ComponentWsRequest()
+ return newWsClient(orchestrator).measures().component(new ComponentRequest()
.setComponentKey(componentKey)
.setMetricKeys(asList(metricKeys))
.setAdditionalFields(singletonList("periods"))).getComponent().getMeasuresList()
@CheckForNull
public static Component getComponent(Orchestrator orchestrator, String componentKey) {
try {
- return newWsClient(orchestrator).components().show(new ShowWsRequest().setKey((componentKey))).getComponent();
+ return newWsClient(orchestrator).components().show(new ShowRequest().setKey((componentKey))).getComponent();
} catch (org.sonarqube.ws.client.HttpException e) {
if (e.code() == 404) {
return null;
newAdminWsClient(orchestrator)
.qualityProfiles()
.restoreProfile(
- RestoreWsRequest.builder()
+ RestoreRequest.builder()
.setBackup(new File(uri))
.setOrganization(organization)
.build());
import org.sonarqube.ws.Issues.Issue;
import org.sonarqube.ws.Issues.SearchWsResponse;
import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.issue.SearchWsRequest;
+import org.sonarqube.ws.client.issue.SearchRequest;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
return new IssueRule(requireNonNull(orchestrator, "Orchestrator instance can not be null"));
}
- public SearchWsResponse search(SearchWsRequest request) {
+ public SearchWsResponse search(SearchRequest request) {
return adminWsClient().issues().search(request);
}
public Issue getRandomIssue() {
- List<Issue> issues = search(new SearchWsRequest()).getIssuesList();
+ List<Issue> issues = search(new SearchRequest()).getIssuesList();
assertThat(issues).isNotEmpty();
return issues.get(0);
}
public Issue getByKey(String issueKey) {
- List<Issue> issues = search(new SearchWsRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("_all"))).getIssuesList();
+ List<Issue> issues = search(new SearchRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("_all"))).getIssuesList();
assertThat(issues).hasSize(1);
return issues.iterator().next();
}
public List<Issue> getByKeys(String... issueKeys) {
- List<Issue> issues = search(new SearchWsRequest().setIssues(asList(issueKeys)).setAdditionalFields(singletonList("_all"))).getIssuesList();
+ List<Issue> issues = search(new SearchRequest().setIssues(asList(issueKeys)).setAdditionalFields(singletonList("_all"))).getIssuesList();
assertThat(issues).hasSize(issueKeys.length);
return issues;
}
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsClient;
import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import org.sonarqube.ws.client.permission.AddUserRequest;
import org.sonarqube.ws.client.roots.SetRootRequest;
import org.sonarqube.ws.client.user.CreateRequest;
import org.sonarqube.ws.client.user.SearchRequest;
import org.sonarqube.ws.client.user.UsersService;
-import org.sonarqube.ws.client.usergroups.AddUserRequest;
import util.selenium.Consumer;
import static java.util.Arrays.asList;
public String createAdminUser(String login, String password) {
createUser(login, password);
- adminWsClient.permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission("admin"));
- adminWsClient.userGroups().addUser(new AddUserRequest().setLogin(login).setName("sonar-administrators"));
+ adminWsClient.permissions().addUser(new AddUserRequest().setLogin(login).setPermission("admin"));
+ adminWsClient.userGroups().addUser(new org.sonarqube.ws.client.usergroups.AddUserRequest().setLogin(login).setName("sonar-administrators"));
return login;
}