@@ -28,10 +28,10 @@ import org.sonarqube.ws.Organizations; | |||
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; | |||
@@ -51,16 +51,16 @@ public class OrganizationTester { | |||
} | |||
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) | |||
@@ -75,14 +75,14 @@ public class OrganizationTester { | |||
} | |||
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; | |||
@@ -116,7 +116,7 @@ public class OrganizationTester { | |||
} | |||
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)) |
@@ -27,7 +27,7 @@ import org.sonarqube.ws.Projects; | |||
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; | |||
@@ -44,7 +44,7 @@ public class ProjectTester { | |||
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())); | |||
} | |||
@@ -29,7 +29,7 @@ import org.sonarqube.ws.Qualityprofiles.CreateWsResponse.QualityProfile; | |||
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; | |||
@@ -69,7 +69,7 @@ public class QProfileTester { | |||
} | |||
public QProfileTester activateRule(String profileKey, String ruleKey) { | |||
ActivateRuleWsRequest request = ActivateRuleWsRequest.builder() | |||
ActivateRuleRequest request = ActivateRuleRequest.builder() | |||
.setKey(profileKey) | |||
.setRuleKey(ruleKey) | |||
.build(); |
@@ -74,7 +74,7 @@ public class UserTester { | |||
@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; | |||
} |
@@ -43,7 +43,7 @@ import org.sonar.server.organization.DefaultOrganizationProvider; | |||
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; | |||
@@ -116,8 +116,8 @@ public class SearchAction implements ComponentsWsAction { | |||
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)) | |||
@@ -126,7 +126,7 @@ public class SearchAction implements ComponentsWsAction { | |||
.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); | |||
@@ -148,7 +148,7 @@ public class SearchAction implements ComponentsWsAction { | |||
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( | |||
@@ -156,7 +156,7 @@ public class SearchAction implements ComponentsWsAction { | |||
"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()) |
@@ -35,7 +35,7 @@ import org.sonar.db.organization.OrganizationDto; | |||
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; | |||
@@ -100,13 +100,13 @@ public class ShowAction implements ComponentsWsAction { | |||
@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()); | |||
@@ -116,7 +116,7 @@ public class ShowAction implements ComponentsWsAction { | |||
} | |||
} | |||
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(); | |||
@@ -139,8 +139,8 @@ public class ShowAction implements ComponentsWsAction { | |||
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)); |
@@ -52,7 +52,7 @@ import org.sonar.server.component.ComponentFinder; | |||
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; | |||
@@ -170,26 +170,26 @@ public class TreeAction implements ComponentsWsAction { | |||
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(); | |||
@@ -246,7 +246,7 @@ public class TreeAction implements ComponentsWsAction { | |||
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() | |||
@@ -263,7 +263,7 @@ public class TreeAction implements ComponentsWsAction { | |||
} | |||
@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())) { | |||
@@ -283,8 +283,8 @@ public class TreeAction implements ComponentsWsAction { | |||
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)) | |||
@@ -297,12 +297,12 @@ public class TreeAction implements ComponentsWsAction { | |||
.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; |
@@ -53,7 +53,7 @@ import org.sonar.db.component.ComponentDto; | |||
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; | |||
@@ -99,7 +99,7 @@ public class IssueQueryFactory { | |||
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()) | |||
@@ -155,7 +155,7 @@ public class IssueQueryFactory { | |||
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(); | |||
@@ -192,7 +192,7 @@ public class IssueQueryFactory { | |||
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(); | |||
@@ -232,7 +232,7 @@ public class IssueQueryFactory { | |||
} | |||
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) { | |||
@@ -259,7 +259,7 @@ public class IssueQueryFactory { | |||
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; | |||
} | |||
@@ -310,7 +310,7 @@ public class IssueQueryFactory { | |||
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) | |||
@@ -320,7 +320,7 @@ public class IssueQueryFactory { | |||
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; | |||
} |
@@ -29,7 +29,7 @@ import org.sonar.api.utils.text.JsonWriter; | |||
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; | |||
@@ -77,12 +77,12 @@ public class ComponentTagsAction implements IssuesWsAction { | |||
@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(); |
@@ -51,7 +51,7 @@ import org.sonar.server.issue.IssueQueryFactory; | |||
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; | |||
@@ -319,7 +319,7 @@ public class SearchAction implements IssuesWsAction { | |||
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); | |||
@@ -366,7 +366,7 @@ public class SearchAction implements IssuesWsAction { | |||
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()); | |||
@@ -388,7 +388,7 @@ public class SearchAction implements IssuesWsAction { | |||
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)); | |||
@@ -457,7 +457,7 @@ public class SearchAction implements IssuesWsAction { | |||
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()); | |||
@@ -465,8 +465,8 @@ public class SearchAction implements IssuesWsAction { | |||
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)) |
@@ -26,7 +26,7 @@ import java.util.HashMap; | |||
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 { | |||
@@ -68,7 +68,7 @@ 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); |
@@ -53,7 +53,7 @@ import org.sonar.server.measure.ws.MetricDtoWithBestValue.MetricDtoToMetricDtoWi | |||
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; | |||
@@ -138,7 +138,7 @@ public class ComponentAction implements MeasuresWsAction { | |||
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); | |||
@@ -153,7 +153,7 @@ public class ComponentAction implements MeasuresWsAction { | |||
} | |||
} | |||
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(); | |||
@@ -164,7 +164,7 @@ public class ComponentAction implements MeasuresWsAction { | |||
} | |||
@CheckForNull | |||
private Long searchDeveloperId(DbSession dbSession, ComponentWsRequest request) { | |||
private Long searchDeveloperId(DbSession dbSession, ComponentRequest request) { | |||
if (request.getDeveloperId() == null && request.getDeveloperKey() == null) { | |||
return null; | |||
} | |||
@@ -180,8 +180,8 @@ public class ComponentAction implements MeasuresWsAction { | |||
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<>(); | |||
@@ -210,7 +210,7 @@ public class ComponentAction implements MeasuresWsAction { | |||
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); | |||
@@ -266,8 +266,8 @@ public class ComponentAction implements MeasuresWsAction { | |||
} | |||
} | |||
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)) | |||
@@ -275,8 +275,8 @@ public class ComponentAction implements MeasuresWsAction { | |||
.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) { |
@@ -40,7 +40,7 @@ import org.sonar.db.component.ComponentTreeQuery.Strategy; | |||
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; | |||
@@ -219,7 +219,7 @@ public class ComponentTreeAction implements MeasuresWsAction { | |||
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); | |||
@@ -234,7 +234,7 @@ public class ComponentTreeAction implements MeasuresWsAction { | |||
.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()) | |||
@@ -269,17 +269,17 @@ public class ComponentTreeAction implements MeasuresWsAction { | |||
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()) | |||
@@ -289,10 +289,10 @@ public class ComponentTreeAction implements MeasuresWsAction { | |||
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)) | |||
@@ -310,20 +310,20 @@ public class ComponentTreeAction implements MeasuresWsAction { | |||
.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, |
@@ -60,7 +60,7 @@ import org.sonar.server.component.ComponentFinder; | |||
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; | |||
@@ -93,7 +93,7 @@ public class ComponentTreeDataLoader { | |||
this.resourceTypes = resourceTypes; | |||
} | |||
ComponentTreeData load(ComponentTreeWsRequest wsRequest) { | |||
ComponentTreeData load(ComponentTreeRequest wsRequest) { | |||
try (DbSession dbSession = dbClient.openSession(false)) { | |||
ComponentDto baseComponent = loadComponent(dbSession, wsRequest); | |||
checkPermissions(baseComponent); | |||
@@ -130,7 +130,7 @@ public class ComponentTreeDataLoader { | |||
} | |||
} | |||
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(); | |||
@@ -141,7 +141,7 @@ public class ComponentTreeDataLoader { | |||
} | |||
@CheckForNull | |||
private Long searchDeveloperId(DbSession dbSession, ComponentTreeWsRequest wsRequest) { | |||
private Long searchDeveloperId(DbSession dbSession, ComponentTreeRequest wsRequest) { | |||
if (wsRequest.getDeveloperId() == null && wsRequest.getDeveloperKey() == null) { | |||
return null; | |||
} | |||
@@ -170,7 +170,7 @@ public class ComponentTreeDataLoader { | |||
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()) { | |||
@@ -246,7 +246,7 @@ public class ComponentTreeDataLoader { | |||
} | |||
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; | |||
} | |||
@@ -261,16 +261,16 @@ public class ComponentTreeDataLoader { | |||
.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()) | |||
@@ -278,7 +278,7 @@ public class ComponentTreeDataLoader { | |||
} | |||
@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())) { | |||
@@ -298,7 +298,7 @@ public class ComponentTreeDataLoader { | |||
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() |
@@ -35,7 +35,7 @@ import org.sonar.api.measures.Metric.ValueType; | |||
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; | |||
@@ -62,8 +62,8 @@ public class ComponentTreeSort { | |||
// 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; | |||
@@ -112,8 +112,8 @@ public class ComponentTreeSort { | |||
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()); | |||
} | |||
@@ -133,8 +133,8 @@ public class ComponentTreeSort { | |||
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()); | |||
} | |||
@@ -160,8 +160,8 @@ public class ComponentTreeSort { | |||
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()) { |
@@ -24,14 +24,14 @@ import java.util.function.Predicate; | |||
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) |
@@ -39,7 +39,7 @@ import org.sonarqube.ws.Common; | |||
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; | |||
@@ -104,7 +104,7 @@ public class SearchProjectPermissionsAction implements PermissionsWsAction { | |||
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); | |||
@@ -113,8 +113,8 @@ public class SearchProjectPermissionsAction implements PermissionsWsAction { | |||
} | |||
} | |||
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)) | |||
@@ -123,7 +123,7 @@ public class SearchProjectPermissionsAction implements PermissionsWsAction { | |||
.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()); |
@@ -34,7 +34,7 @@ import org.sonar.db.DbSession; | |||
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; | |||
@@ -52,7 +52,7 @@ public class SearchProjectPermissionsDataLoader { | |||
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)); | |||
@@ -66,17 +66,17 @@ public class SearchProjectPermissionsDataLoader { | |||
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()) { | |||
@@ -86,7 +86,7 @@ public class SearchProjectPermissionsDataLoader { | |||
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()) |
@@ -31,7 +31,7 @@ import org.sonar.db.permission.template.PermissionTemplateDto; | |||
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; | |||
@@ -55,8 +55,8 @@ public class AddProjectCreatorToTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -85,7 +85,7 @@ public class AddProjectCreatorToTemplateAction implements PermissionsWsAction { | |||
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())); | |||
@@ -101,7 +101,7 @@ public class AddProjectCreatorToTemplateAction implements PermissionsWsAction { | |||
} | |||
} | |||
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()) |
@@ -32,7 +32,7 @@ import org.sonar.server.permission.UserId; | |||
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; | |||
@@ -56,8 +56,8 @@ public class AddUserToTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -86,7 +86,7 @@ public class AddUserToTemplateAction implements PermissionsWsAction { | |||
response.noContent(); | |||
} | |||
private void doHandle(AddUserToTemplateWsRequest request) { | |||
private void doHandle(AddUserToTemplateRequest request) { | |||
String permission = request.getPermission(); | |||
String userLogin = request.getLogin(); | |||
@@ -31,7 +31,7 @@ import org.sonar.server.permission.PermissionTemplateService; | |||
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; | |||
@@ -58,8 +58,8 @@ public class ApplyTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -88,7 +88,7 @@ public class ApplyTemplateAction implements PermissionsWsAction { | |||
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())); |
@@ -39,7 +39,7 @@ import org.sonar.server.permission.ws.PermissionWsSupport; | |||
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; | |||
@@ -137,7 +137,7 @@ public class BulkApplyTemplateAction implements PermissionsWsAction { | |||
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())); | |||
@@ -150,8 +150,8 @@ public class BulkApplyTemplateAction implements PermissionsWsAction { | |||
} | |||
} | |||
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)) | |||
@@ -163,7 +163,7 @@ public class BulkApplyTemplateAction implements PermissionsWsAction { | |||
.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()])); |
@@ -34,7 +34,7 @@ import org.sonar.server.permission.ws.PermissionsWsAction; | |||
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; | |||
@@ -65,8 +65,8 @@ public class CreateTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -104,7 +104,7 @@ public class CreateTemplateAction implements PermissionsWsAction { | |||
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()); | |||
@@ -126,7 +126,7 @@ public class CreateTemplateAction implements PermissionsWsAction { | |||
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()) |
@@ -29,7 +29,7 @@ import org.sonar.db.permission.template.PermissionTemplateDto; | |||
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; | |||
@@ -53,8 +53,8 @@ public class DeleteTemplateAction implements PermissionsWsAction { | |||
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)); | |||
@@ -79,7 +79,7 @@ public class DeleteTemplateAction implements PermissionsWsAction { | |||
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())); |
@@ -31,7 +31,7 @@ import org.sonar.db.permission.template.PermissionTemplateDto; | |||
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; | |||
@@ -55,8 +55,8 @@ public class RemoveProjectCreatorFromTemplateAction implements PermissionsWsActi | |||
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)) | |||
@@ -85,7 +85,7 @@ public class RemoveProjectCreatorFromTemplateAction implements PermissionsWsActi | |||
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())); |
@@ -29,7 +29,7 @@ import org.sonar.server.permission.UserId; | |||
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; | |||
@@ -53,8 +53,8 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -83,7 +83,7 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction { | |||
response.noContent(); | |||
} | |||
private void doHandle(RemoveUserFromTemplateWsRequest request) { | |||
private void doHandle(RemoveUserFromTemplateRequest request) { | |||
String permission = request.getPermission(); | |||
String userLogin = request.getLogin(); | |||
@@ -39,7 +39,7 @@ import org.sonarqube.ws.Permissions.Permission; | |||
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; | |||
@@ -83,7 +83,7 @@ public class SearchTemplatesAction implements PermissionsWsAction { | |||
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()); |
@@ -30,7 +30,7 @@ import org.sonar.db.permission.template.CountByTemplateAndPermissionDto; | |||
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; | |||
@@ -44,7 +44,7 @@ public class SearchTemplatesDataLoader { | |||
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); | |||
@@ -63,7 +63,7 @@ public class SearchTemplatesDataLoader { | |||
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()); | |||
} | |||
@@ -33,7 +33,7 @@ import org.sonar.db.permission.template.PermissionTemplateDto; | |||
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; | |||
@@ -63,8 +63,8 @@ public class SetDefaultTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -91,7 +91,7 @@ public class SetDefaultTemplateAction implements PermissionsWsAction { | |||
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); | |||
@@ -102,7 +102,7 @@ public class SetDefaultTemplateAction implements PermissionsWsAction { | |||
} | |||
} | |||
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())); | |||
} |
@@ -33,7 +33,7 @@ import org.sonar.server.permission.ws.PermissionsWsAction; | |||
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; | |||
@@ -65,8 +65,8 @@ public class UpdateTemplateAction implements PermissionsWsAction { | |||
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)) | |||
@@ -104,7 +104,7 @@ public class UpdateTemplateAction implements PermissionsWsAction { | |||
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(); |
@@ -31,7 +31,7 @@ import org.sonar.db.permission.OrganizationPermission; | |||
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; | |||
@@ -127,7 +127,7 @@ public class BulkDeleteAction implements ProjectsWsAction { | |||
@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()); | |||
@@ -140,8 +140,8 @@ public class BulkDeleteAction implements ProjectsWsAction { | |||
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)) |
@@ -36,7 +36,7 @@ import org.sonar.server.component.ComponentFinder.ParamNames; | |||
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; | |||
@@ -131,7 +131,7 @@ public class BulkUpdateKeyAction implements ProjectsWsAction { | |||
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); | |||
@@ -153,7 +153,7 @@ public class BulkUpdateKeyAction implements ProjectsWsAction { | |||
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()); | |||
} | |||
@@ -175,8 +175,8 @@ public class BulkUpdateKeyAction implements ProjectsWsAction { | |||
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)) |
@@ -40,7 +40,7 @@ import org.sonar.db.permission.OrganizationPermission; | |||
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; | |||
@@ -147,8 +147,8 @@ public class SearchAction implements ProjectsWsAction { | |||
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)) | |||
@@ -162,7 +162,7 @@ public class SearchAction implements ProjectsWsAction { | |||
.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); | |||
@@ -177,7 +177,7 @@ public class SearchAction implements ProjectsWsAction { | |||
} | |||
} | |||
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()])); | |||
@@ -196,7 +196,7 @@ public class SearchAction implements ProjectsWsAction { | |||
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()) |
@@ -30,7 +30,7 @@ import org.sonar.db.component.ComponentDto; | |||
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; | |||
@@ -97,15 +97,15 @@ public class UpdateKeyAction implements ProjectsWsAction { | |||
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)) |
@@ -52,7 +52,7 @@ import org.sonar.server.user.UserSession; | |||
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; | |||
@@ -132,8 +132,8 @@ public class SearchAction implements QProfileWsAction { | |||
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)) | |||
@@ -141,12 +141,12 @@ public class SearchAction implements QProfileWsAction { | |||
.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()); | |||
@@ -172,7 +172,7 @@ public class SearchAction implements QProfileWsAction { | |||
} | |||
@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; | |||
} | |||
@@ -205,7 +205,7 @@ public class SearchAction implements QProfileWsAction { | |||
.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); | |||
@@ -223,15 +223,15 @@ public class SearchAction implements QProfileWsAction { | |||
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()); | |||
} |
@@ -53,7 +53,7 @@ import org.sonar.server.ws.WsActionTester; | |||
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; | |||
@@ -140,7 +140,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -153,7 +153,7 @@ public class SearchActionTest { | |||
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()); | |||
} | |||
@@ -167,7 +167,7 @@ public class SearchActionTest { | |||
} | |||
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"); | |||
} | |||
@@ -179,7 +179,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -194,7 +194,7 @@ public class SearchActionTest { | |||
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()); | |||
@@ -211,7 +211,7 @@ public class SearchActionTest { | |||
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()), | |||
@@ -227,7 +227,7 @@ public class SearchActionTest { | |||
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()); | |||
@@ -238,7 +238,7 @@ public class SearchActionTest { | |||
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 | |||
@@ -246,7 +246,7 @@ public class SearchActionTest { | |||
expectedException.expect(IllegalArgumentException.class); | |||
expectedException.expectMessage("The 'qualifiers' parameter is missing"); | |||
call(new SearchWsRequest()); | |||
call(new SearchRequest()); | |||
} | |||
@Test | |||
@@ -279,7 +279,7 @@ public class SearchActionTest { | |||
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)); |
@@ -35,7 +35,7 @@ import org.sonar.db.component.SnapshotDto; | |||
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; | |||
@@ -70,7 +70,7 @@ public class IssueQueryFactoryTest { | |||
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")) | |||
@@ -117,7 +117,7 @@ public class IssueQueryFactoryTest { | |||
@Test | |||
public void dates_are_inclusive() { | |||
SearchWsRequest request = new SearchWsRequest() | |||
SearchRequest request = new SearchRequest() | |||
.setCreatedAfter("2013-04-16") | |||
.setCreatedBefore("2013-04-17"); | |||
@@ -129,7 +129,7 @@ public class IssueQueryFactoryTest { | |||
@Test | |||
public void creation_date_support_localdate() { | |||
SearchWsRequest request = new SearchWsRequest() | |||
SearchRequest request = new SearchRequest() | |||
.setCreatedAt("2013-04-16"); | |||
IssueQuery query = underTest.create(request); | |||
@@ -139,7 +139,7 @@ public class IssueQueryFactoryTest { | |||
@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); | |||
@@ -149,7 +149,7 @@ public class IssueQueryFactoryTest { | |||
@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); | |||
@@ -159,7 +159,7 @@ public class IssueQueryFactoryTest { | |||
@Test | |||
public void query_without_any_parameter() { | |||
SearchWsRequest request = new SearchWsRequest(); | |||
SearchRequest request = new SearchRequest(); | |||
IssueQuery query = underTest.create(request); | |||
@@ -185,7 +185,7 @@ public class IssueQueryFactoryTest { | |||
@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")); | |||
@@ -197,7 +197,7 @@ public class IssueQueryFactoryTest { | |||
@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")); | |||
@@ -209,7 +209,7 @@ public class IssueQueryFactoryTest { | |||
@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")); | |||
@@ -223,7 +223,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -235,7 +235,7 @@ public class IssueQueryFactoryTest { | |||
@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); | |||
@@ -254,7 +254,7 @@ public class IssueQueryFactoryTest { | |||
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()); | |||
} | |||
@@ -273,7 +273,7 @@ public class IssueQueryFactoryTest { | |||
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)); | |||
@@ -286,7 +286,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -297,7 +297,7 @@ public class IssueQueryFactoryTest { | |||
@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); | |||
@@ -308,7 +308,7 @@ public class IssueQueryFactoryTest { | |||
@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); | |||
@@ -323,7 +323,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -335,7 +335,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -349,7 +349,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -361,7 +361,7 @@ public class IssueQueryFactoryTest { | |||
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); | |||
@@ -374,13 +374,13 @@ public class IssueQueryFactoryTest { | |||
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) | |||
@@ -393,20 +393,20 @@ public class IssueQueryFactoryTest { | |||
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()))) | |||
@@ -420,7 +420,7 @@ public class IssueQueryFactoryTest { | |||
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))) | |||
@@ -433,12 +433,12 @@ public class IssueQueryFactoryTest { | |||
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) | |||
@@ -447,7 +447,7 @@ public class IssueQueryFactoryTest { | |||
@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"); | |||
@@ -464,7 +464,7 @@ public class IssueQueryFactoryTest { | |||
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")); | |||
} | |||
@@ -474,7 +474,7 @@ public class IssueQueryFactoryTest { | |||
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")); | |||
} | |||
@@ -484,7 +484,7 @@ public class IssueQueryFactoryTest { | |||
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 | |||
@@ -495,7 +495,7 @@ public class IssueQueryFactoryTest { | |||
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()))); | |||
} | |||
@@ -505,13 +505,13 @@ public class IssueQueryFactoryTest { | |||
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); |
@@ -31,7 +31,7 @@ import org.sonar.server.issue.IssueQueryFactory; | |||
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; | |||
@@ -89,7 +89,7 @@ public class ComponentTagsActionTest { | |||
.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); | |||
@@ -113,7 +113,7 @@ public class ComponentTagsActionTest { | |||
.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); | |||
@@ -32,7 +32,7 @@ import org.sonar.core.util.Uuids; | |||
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; | |||
@@ -88,7 +88,7 @@ public class ComponentTreeSortTest { | |||
@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") | |||
@@ -97,7 +97,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -107,7 +107,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -118,7 +118,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -129,7 +129,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -144,7 +144,7 @@ public class ComponentTreeSortTest { | |||
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); | |||
@@ -170,7 +170,7 @@ public class ComponentTreeSortTest { | |||
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); | |||
@@ -183,7 +183,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -194,7 +194,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -205,7 +205,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -216,7 +216,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -227,7 +227,7 @@ public class ComponentTreeSortTest { | |||
@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); | |||
@@ -241,7 +241,7 @@ public class ComponentTreeSortTest { | |||
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); | |||
@@ -249,7 +249,7 @@ public class ComponentTreeSortTest { | |||
.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); | |||
} | |||
@@ -261,8 +261,8 @@ public class ComponentTreeSortTest { | |||
.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); |
@@ -48,7 +48,7 @@ import org.sonar.server.ws.WsActionTester; | |||
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; | |||
@@ -73,7 +73,7 @@ public class SearchMembersActionTest { | |||
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() { |
@@ -48,7 +48,7 @@ import org.sonarqube.ws.MediaTypes; | |||
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; | |||
@@ -104,7 +104,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -116,7 +116,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -128,7 +128,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -140,7 +140,7 @@ public class SearchActionTest { | |||
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); | |||
} | |||
@@ -157,7 +157,7 @@ public class SearchActionTest { | |||
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); | |||
} | |||
@@ -169,7 +169,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -181,7 +181,7 @@ public class SearchActionTest { | |||
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"); | |||
} | |||
@@ -195,7 +195,7 @@ public class SearchActionTest { | |||
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); | |||
} | |||
@@ -210,7 +210,7 @@ public class SearchActionTest { | |||
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()); | |||
} | |||
@@ -226,7 +226,7 @@ public class SearchActionTest { | |||
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()) | |||
@@ -239,7 +239,7 @@ public class SearchActionTest { | |||
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()); | |||
} | |||
@@ -253,7 +253,7 @@ public class SearchActionTest { | |||
} | |||
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"); | |||
} | |||
@@ -265,7 +265,7 @@ public class SearchActionTest { | |||
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()) | |||
@@ -279,7 +279,7 @@ public class SearchActionTest { | |||
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()); | |||
@@ -295,7 +295,7 @@ public class SearchActionTest { | |||
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()); | |||
@@ -309,14 +309,14 @@ public class SearchActionTest { | |||
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 | |||
@@ -325,7 +325,7 @@ public class SearchActionTest { | |||
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 | |||
@@ -408,7 +408,7 @@ public class SearchActionTest { | |||
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(); |
@@ -52,7 +52,7 @@ public class ComponentsService extends BaseService { | |||
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())) | |||
@@ -62,7 +62,7 @@ public class ComponentsService extends BaseService { | |||
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()) | |||
@@ -77,7 +77,7 @@ public class ComponentsService extends BaseService { | |||
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()) | |||
@@ -100,7 +100,7 @@ public class ComponentsService extends BaseService { | |||
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(","))) |
@@ -25,7 +25,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class SearchWsRequest { | |||
public class SearchRequest { | |||
private String organization; | |||
private List<String> qualifiers; | |||
private Integer page; | |||
@@ -38,7 +38,7 @@ public class SearchWsRequest { | |||
return organization; | |||
} | |||
public SearchWsRequest setOrganization(@Nullable String organization) { | |||
public SearchRequest setOrganization(@Nullable String organization) { | |||
this.organization = organization; | |||
return this; | |||
} | |||
@@ -47,7 +47,7 @@ public class SearchWsRequest { | |||
return qualifiers; | |||
} | |||
public SearchWsRequest setQualifiers(List<String> qualifiers) { | |||
public SearchRequest setQualifiers(List<String> qualifiers) { | |||
this.qualifiers = requireNonNull(qualifiers); | |||
return this; | |||
} | |||
@@ -57,7 +57,7 @@ public class SearchWsRequest { | |||
return page; | |||
} | |||
public SearchWsRequest setPage(int page) { | |||
public SearchRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -67,7 +67,7 @@ public class SearchWsRequest { | |||
return pageSize; | |||
} | |||
public SearchWsRequest setPageSize(int pageSize) { | |||
public SearchRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} | |||
@@ -77,7 +77,7 @@ public class SearchWsRequest { | |||
return query; | |||
} | |||
public SearchWsRequest setQuery(@Nullable String query) { | |||
public SearchRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -87,7 +87,7 @@ public class SearchWsRequest { | |||
return language; | |||
} | |||
public SearchWsRequest setLanguage(@Nullable String language) { | |||
public SearchRequest setLanguage(@Nullable String language) { | |||
this.language = language; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.component; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class ShowWsRequest { | |||
public class ShowRequest { | |||
private String id; | |||
private String key; | |||
private String branch; | |||
@@ -32,7 +32,7 @@ public class ShowWsRequest { | |||
return id; | |||
} | |||
public ShowWsRequest setId(@Nullable String id) { | |||
public ShowRequest setId(@Nullable String id) { | |||
this.id = id; | |||
return this; | |||
} | |||
@@ -42,7 +42,7 @@ public class ShowWsRequest { | |||
return key; | |||
} | |||
public ShowWsRequest setKey(@Nullable String key) { | |||
public ShowRequest setKey(@Nullable String key) { | |||
this.key = key; | |||
return this; | |||
} | |||
@@ -52,7 +52,7 @@ public class ShowWsRequest { | |||
return branch; | |||
} | |||
public ShowWsRequest setBranch(@Nullable String branch) { | |||
public ShowRequest setBranch(@Nullable String branch) { | |||
this.branch = branch; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.component; | |||
import java.util.Collections; | |||
import java.util.List; | |||
public class SuggestionsWsRequest { | |||
public class SuggestionsRequest { | |||
public static final int MAX_PAGE_SIZE = 500; | |||
public static final int DEFAULT_PAGE_SIZE = 100; | |||
@@ -41,7 +41,7 @@ public class SuggestionsWsRequest { | |||
private final List<String> recentlyBrowsed; | |||
private final String s; | |||
private SuggestionsWsRequest(Builder builder) { | |||
private SuggestionsRequest(Builder builder) { | |||
this.more = builder.more; | |||
this.recentlyBrowsed = builder.recentlyBrowsed; | |||
this.s = builder.s; | |||
@@ -88,8 +88,8 @@ public class SuggestionsWsRequest { | |||
return this; | |||
} | |||
public SuggestionsWsRequest build() { | |||
return new SuggestionsWsRequest(this); | |||
public SuggestionsRequest build() { | |||
return new SuggestionsRequest(this); | |||
} | |||
} | |||
} |
@@ -23,7 +23,7 @@ import java.util.List; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class TreeWsRequest { | |||
public class TreeRequest { | |||
private String baseComponentId; | |||
private String baseComponentKey; | |||
private String component; | |||
@@ -49,7 +49,7 @@ public class TreeWsRequest { | |||
* @deprecated since 6.4, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public TreeWsRequest setBaseComponentId(@Nullable String baseComponentId) { | |||
public TreeRequest setBaseComponentId(@Nullable String baseComponentId) { | |||
this.baseComponentId = baseComponentId; | |||
return this; | |||
} | |||
@@ -67,12 +67,12 @@ public class TreeWsRequest { | |||
* @deprecated since 6.4, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public TreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { | |||
public TreeRequest setBaseComponentKey(@Nullable String baseComponentKey) { | |||
this.baseComponentKey = baseComponentKey; | |||
return this; | |||
} | |||
public TreeWsRequest setComponent(@Nullable String component) { | |||
public TreeRequest setComponent(@Nullable String component) { | |||
this.component = component; | |||
return this; | |||
} | |||
@@ -87,7 +87,7 @@ public class TreeWsRequest { | |||
return branch; | |||
} | |||
public TreeWsRequest setBranch(@Nullable String branch) { | |||
public TreeRequest setBranch(@Nullable String branch) { | |||
this.branch = branch; | |||
return this; | |||
} | |||
@@ -97,7 +97,7 @@ public class TreeWsRequest { | |||
return strategy; | |||
} | |||
public TreeWsRequest setStrategy(@Nullable String strategy) { | |||
public TreeRequest setStrategy(@Nullable String strategy) { | |||
this.strategy = strategy; | |||
return this; | |||
} | |||
@@ -107,7 +107,7 @@ public class TreeWsRequest { | |||
return qualifiers; | |||
} | |||
public TreeWsRequest setQualifiers(@Nullable List<String> qualifiers) { | |||
public TreeRequest setQualifiers(@Nullable List<String> qualifiers) { | |||
this.qualifiers = qualifiers; | |||
return this; | |||
} | |||
@@ -117,7 +117,7 @@ public class TreeWsRequest { | |||
return query; | |||
} | |||
public TreeWsRequest setQuery(@Nullable String query) { | |||
public TreeRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -127,7 +127,7 @@ public class TreeWsRequest { | |||
return sort; | |||
} | |||
public TreeWsRequest setSort(@Nullable List<String> sort) { | |||
public TreeRequest setSort(@Nullable List<String> sort) { | |||
this.sort = sort; | |||
return this; | |||
} | |||
@@ -136,7 +136,7 @@ public class TreeWsRequest { | |||
return asc; | |||
} | |||
public TreeWsRequest setAsc(@Nullable Boolean asc) { | |||
public TreeRequest setAsc(@Nullable Boolean asc) { | |||
this.asc = asc; | |||
return this; | |||
} | |||
@@ -146,7 +146,7 @@ public class TreeWsRequest { | |||
return page; | |||
} | |||
public TreeWsRequest setPage(@Nullable Integer page) { | |||
public TreeRequest setPage(@Nullable Integer page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -156,7 +156,7 @@ public class TreeWsRequest { | |||
return pageSize; | |||
} | |||
public TreeWsRequest setPageSize(@Nullable Integer pageSize) { | |||
public TreeRequest setPageSize(@Nullable Integer pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} |
@@ -158,7 +158,7 @@ public class IssuesService extends BaseService { | |||
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())) |
@@ -23,7 +23,7 @@ import java.util.List; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SearchWsRequest { | |||
public class SearchRequest { | |||
private List<String> actionPlans; | |||
private List<String> additionalFields; | |||
private Boolean asc; | |||
@@ -69,7 +69,7 @@ public class SearchWsRequest { | |||
return actionPlans; | |||
} | |||
public SearchWsRequest setActionPlans(@Nullable List<String> actionPlans) { | |||
public SearchRequest setActionPlans(@Nullable List<String> actionPlans) { | |||
this.actionPlans = actionPlans; | |||
return this; | |||
} | |||
@@ -79,7 +79,7 @@ public class SearchWsRequest { | |||
return additionalFields; | |||
} | |||
public SearchWsRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
public SearchRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
this.additionalFields = additionalFields; | |||
return this; | |||
} | |||
@@ -89,7 +89,7 @@ public class SearchWsRequest { | |||
return asc; | |||
} | |||
public SearchWsRequest setAsc(boolean asc) { | |||
public SearchRequest setAsc(boolean asc) { | |||
this.asc = asc; | |||
return this; | |||
} | |||
@@ -99,7 +99,7 @@ public class SearchWsRequest { | |||
return assigned; | |||
} | |||
public SearchWsRequest setAssigned(@Nullable Boolean assigned) { | |||
public SearchRequest setAssigned(@Nullable Boolean assigned) { | |||
this.assigned = assigned; | |||
return this; | |||
} | |||
@@ -109,7 +109,7 @@ public class SearchWsRequest { | |||
return assignees; | |||
} | |||
public SearchWsRequest setAssignees(@Nullable List<String> assignees) { | |||
public SearchRequest setAssignees(@Nullable List<String> assignees) { | |||
this.assignees = assignees; | |||
return this; | |||
} | |||
@@ -119,7 +119,7 @@ public class SearchWsRequest { | |||
return authors; | |||
} | |||
public SearchWsRequest setAuthors(@Nullable List<String> authors) { | |||
public SearchRequest setAuthors(@Nullable List<String> authors) { | |||
this.authors = authors; | |||
return this; | |||
} | |||
@@ -129,7 +129,7 @@ public class SearchWsRequest { | |||
return componentKeys; | |||
} | |||
public SearchWsRequest setComponentKeys(@Nullable List<String> componentKeys) { | |||
public SearchRequest setComponentKeys(@Nullable List<String> componentKeys) { | |||
this.componentKeys = componentKeys; | |||
return this; | |||
} | |||
@@ -139,7 +139,7 @@ public class SearchWsRequest { | |||
return componentUuids; | |||
} | |||
public SearchWsRequest setComponentUuids(@Nullable List<String> componentUuids) { | |||
public SearchRequest setComponentUuids(@Nullable List<String> componentUuids) { | |||
this.componentUuids = componentUuids; | |||
return this; | |||
} | |||
@@ -149,7 +149,7 @@ public class SearchWsRequest { | |||
return createdAfter; | |||
} | |||
public SearchWsRequest setCreatedAfter(@Nullable String createdAfter) { | |||
public SearchRequest setCreatedAfter(@Nullable String createdAfter) { | |||
this.createdAfter = createdAfter; | |||
return this; | |||
} | |||
@@ -159,7 +159,7 @@ public class SearchWsRequest { | |||
return createdAt; | |||
} | |||
public SearchWsRequest setCreatedAt(@Nullable String createdAt) { | |||
public SearchRequest setCreatedAt(@Nullable String createdAt) { | |||
this.createdAt = createdAt; | |||
return this; | |||
} | |||
@@ -169,7 +169,7 @@ public class SearchWsRequest { | |||
return createdBefore; | |||
} | |||
public SearchWsRequest setCreatedBefore(@Nullable String createdBefore) { | |||
public SearchRequest setCreatedBefore(@Nullable String createdBefore) { | |||
this.createdBefore = createdBefore; | |||
return this; | |||
} | |||
@@ -179,7 +179,7 @@ public class SearchWsRequest { | |||
return createdInLast; | |||
} | |||
public SearchWsRequest setCreatedInLast(@Nullable String createdInLast) { | |||
public SearchRequest setCreatedInLast(@Nullable String createdInLast) { | |||
this.createdInLast = createdInLast; | |||
return this; | |||
} | |||
@@ -189,7 +189,7 @@ public class SearchWsRequest { | |||
return directories; | |||
} | |||
public SearchWsRequest setDirectories(@Nullable List<String> directories) { | |||
public SearchRequest setDirectories(@Nullable List<String> directories) { | |||
this.directories = directories; | |||
return this; | |||
} | |||
@@ -199,7 +199,7 @@ public class SearchWsRequest { | |||
return facetMode; | |||
} | |||
public SearchWsRequest setFacetMode(@Nullable String facetMode) { | |||
public SearchRequest setFacetMode(@Nullable String facetMode) { | |||
this.facetMode = facetMode; | |||
return this; | |||
} | |||
@@ -209,7 +209,7 @@ public class SearchWsRequest { | |||
return facets; | |||
} | |||
public SearchWsRequest setFacets(@Nullable List<String> facets) { | |||
public SearchRequest setFacets(@Nullable List<String> facets) { | |||
this.facets = facets; | |||
return this; | |||
} | |||
@@ -219,7 +219,7 @@ public class SearchWsRequest { | |||
return fileUuids; | |||
} | |||
public SearchWsRequest setFileUuids(@Nullable List<String> fileUuids) { | |||
public SearchRequest setFileUuids(@Nullable List<String> fileUuids) { | |||
this.fileUuids = fileUuids; | |||
return this; | |||
} | |||
@@ -229,7 +229,7 @@ public class SearchWsRequest { | |||
return issues; | |||
} | |||
public SearchWsRequest setIssues(@Nullable List<String> issues) { | |||
public SearchRequest setIssues(@Nullable List<String> issues) { | |||
this.issues = issues; | |||
return this; | |||
} | |||
@@ -239,7 +239,7 @@ public class SearchWsRequest { | |||
return languages; | |||
} | |||
public SearchWsRequest setLanguages(@Nullable List<String> languages) { | |||
public SearchRequest setLanguages(@Nullable List<String> languages) { | |||
this.languages = languages; | |||
return this; | |||
} | |||
@@ -249,7 +249,7 @@ public class SearchWsRequest { | |||
return moduleUuids; | |||
} | |||
public SearchWsRequest setModuleUuids(@Nullable List<String> moduleUuids) { | |||
public SearchRequest setModuleUuids(@Nullable List<String> moduleUuids) { | |||
this.moduleUuids = moduleUuids; | |||
return this; | |||
} | |||
@@ -259,7 +259,7 @@ public class SearchWsRequest { | |||
return onComponentOnly; | |||
} | |||
public SearchWsRequest setOnComponentOnly(Boolean onComponentOnly) { | |||
public SearchRequest setOnComponentOnly(Boolean onComponentOnly) { | |||
this.onComponentOnly = onComponentOnly; | |||
return this; | |||
} | |||
@@ -269,7 +269,7 @@ public class SearchWsRequest { | |||
return organization; | |||
} | |||
public SearchWsRequest setOrganization(@Nullable String s) { | |||
public SearchRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -279,7 +279,7 @@ public class SearchWsRequest { | |||
return page; | |||
} | |||
public SearchWsRequest setPage(int page) { | |||
public SearchRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -289,7 +289,7 @@ public class SearchWsRequest { | |||
return pageSize; | |||
} | |||
public SearchWsRequest setPageSize(int pageSize) { | |||
public SearchRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} | |||
@@ -299,7 +299,7 @@ public class SearchWsRequest { | |||
return projectKeys; | |||
} | |||
public SearchWsRequest setProjectKeys(@Nullable List<String> projectKeys) { | |||
public SearchRequest setProjectKeys(@Nullable List<String> projectKeys) { | |||
this.projectKeys = projectKeys; | |||
return this; | |||
} | |||
@@ -309,7 +309,7 @@ public class SearchWsRequest { | |||
return projectUuids; | |||
} | |||
public SearchWsRequest setProjectUuids(@Nullable List<String> projectUuids) { | |||
public SearchRequest setProjectUuids(@Nullable List<String> projectUuids) { | |||
this.projectUuids = projectUuids; | |||
return this; | |||
} | |||
@@ -319,7 +319,7 @@ public class SearchWsRequest { | |||
return resolutions; | |||
} | |||
public SearchWsRequest setResolutions(@Nullable List<String> resolutions) { | |||
public SearchRequest setResolutions(@Nullable List<String> resolutions) { | |||
this.resolutions = resolutions; | |||
return this; | |||
} | |||
@@ -329,7 +329,7 @@ public class SearchWsRequest { | |||
return resolved; | |||
} | |||
public SearchWsRequest setResolved(@Nullable Boolean resolved) { | |||
public SearchRequest setResolved(@Nullable Boolean resolved) { | |||
this.resolved = resolved; | |||
return this; | |||
} | |||
@@ -339,7 +339,7 @@ public class SearchWsRequest { | |||
return rules; | |||
} | |||
public SearchWsRequest setRules(@Nullable List<String> rules) { | |||
public SearchRequest setRules(@Nullable List<String> rules) { | |||
this.rules = rules; | |||
return this; | |||
} | |||
@@ -349,7 +349,7 @@ public class SearchWsRequest { | |||
return sinceLeakPeriod; | |||
} | |||
public SearchWsRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) { | |||
public SearchRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) { | |||
this.sinceLeakPeriod = sinceLeakPeriod; | |||
return this; | |||
} | |||
@@ -359,7 +359,7 @@ public class SearchWsRequest { | |||
return sort; | |||
} | |||
public SearchWsRequest setSort(@Nullable String sort) { | |||
public SearchRequest setSort(@Nullable String sort) { | |||
this.sort = sort; | |||
return this; | |||
} | |||
@@ -369,7 +369,7 @@ public class SearchWsRequest { | |||
return severities; | |||
} | |||
public SearchWsRequest setSeverities(@Nullable List<String> severities) { | |||
public SearchRequest setSeverities(@Nullable List<String> severities) { | |||
this.severities = severities; | |||
return this; | |||
} | |||
@@ -379,7 +379,7 @@ public class SearchWsRequest { | |||
return statuses; | |||
} | |||
public SearchWsRequest setStatuses(@Nullable List<String> statuses) { | |||
public SearchRequest setStatuses(@Nullable List<String> statuses) { | |||
this.statuses = statuses; | |||
return this; | |||
} | |||
@@ -389,7 +389,7 @@ public class SearchWsRequest { | |||
return tags; | |||
} | |||
public SearchWsRequest setTags(@Nullable List<String> tags) { | |||
public SearchRequest setTags(@Nullable List<String> tags) { | |||
this.tags = tags; | |||
return this; | |||
} | |||
@@ -399,7 +399,7 @@ public class SearchWsRequest { | |||
return types; | |||
} | |||
public SearchWsRequest setTypes(@Nullable List<String> types) { | |||
public SearchRequest setTypes(@Nullable List<String> types) { | |||
this.types = types; | |||
return this; | |||
} | |||
@@ -409,7 +409,7 @@ public class SearchWsRequest { | |||
return componentRootUuids; | |||
} | |||
public SearchWsRequest setComponentRootUuids(List<String> componentRootUuids) { | |||
public SearchRequest setComponentRootUuids(List<String> componentRootUuids) { | |||
this.componentRootUuids = componentRootUuids; | |||
return this; | |||
} | |||
@@ -419,7 +419,7 @@ public class SearchWsRequest { | |||
return componentRoots; | |||
} | |||
public SearchWsRequest setComponentRoots(@Nullable List<String> componentRoots) { | |||
public SearchRequest setComponentRoots(@Nullable List<String> componentRoots) { | |||
this.componentRoots = componentRoots; | |||
return this; | |||
} | |||
@@ -429,7 +429,7 @@ public class SearchWsRequest { | |||
return components; | |||
} | |||
public SearchWsRequest setComponents(@Nullable List<String> components) { | |||
public SearchRequest setComponents(@Nullable List<String> components) { | |||
this.components = components; | |||
return this; | |||
} | |||
@@ -439,7 +439,7 @@ public class SearchWsRequest { | |||
return projects; | |||
} | |||
public SearchWsRequest setProjects(@Nullable List<String> projects) { | |||
public SearchRequest setProjects(@Nullable List<String> projects) { | |||
this.projects = projects; | |||
return this; | |||
} | |||
@@ -449,7 +449,7 @@ public class SearchWsRequest { | |||
return branch; | |||
} | |||
public SearchWsRequest setBranch(@Nullable String branch) { | |||
public SearchRequest setBranch(@Nullable String branch) { | |||
this.branch = branch; | |||
return this; | |||
} |
@@ -23,7 +23,7 @@ import java.util.List; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class ComponentWsRequest { | |||
public class ComponentRequest { | |||
private String componentId; | |||
private String componentKey; | |||
private String component; | |||
@@ -46,7 +46,7 @@ public class ComponentWsRequest { | |||
* @deprecated since 6.6, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public ComponentWsRequest setComponentId(@Nullable String componentId) { | |||
public ComponentRequest setComponentId(@Nullable String componentId) { | |||
this.componentId = componentId; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class ComponentWsRequest { | |||
* @deprecated since 6.6, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public ComponentWsRequest setComponentKey(@Nullable String componentKey) { | |||
public ComponentRequest setComponentKey(@Nullable String componentKey) { | |||
this.componentKey = componentKey; | |||
return this; | |||
} | |||
@@ -74,7 +74,7 @@ public class ComponentWsRequest { | |||
return component; | |||
} | |||
public ComponentWsRequest setComponent(@Nullable String component) { | |||
public ComponentRequest setComponent(@Nullable String component) { | |||
this.component = component; | |||
return this; | |||
} | |||
@@ -84,7 +84,7 @@ public class ComponentWsRequest { | |||
return branch; | |||
} | |||
public ComponentWsRequest setBranch(@Nullable String branch) { | |||
public ComponentRequest setBranch(@Nullable String branch) { | |||
this.branch = branch; | |||
return this; | |||
} | |||
@@ -93,7 +93,7 @@ public class ComponentWsRequest { | |||
return metricKeys; | |||
} | |||
public ComponentWsRequest setMetricKeys(@Nullable List<String> metricKeys) { | |||
public ComponentRequest setMetricKeys(@Nullable List<String> metricKeys) { | |||
this.metricKeys = metricKeys; | |||
return this; | |||
} | |||
@@ -103,7 +103,7 @@ public class ComponentWsRequest { | |||
return additionalFields; | |||
} | |||
public ComponentWsRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
public ComponentRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
this.additionalFields = additionalFields; | |||
return this; | |||
} | |||
@@ -113,7 +113,7 @@ public class ComponentWsRequest { | |||
return developerId; | |||
} | |||
public ComponentWsRequest setDeveloperId(@Nullable String developerId) { | |||
public ComponentRequest setDeveloperId(@Nullable String developerId) { | |||
this.developerId = developerId; | |||
return this; | |||
} | |||
@@ -123,7 +123,7 @@ public class ComponentWsRequest { | |||
return developerKey; | |||
} | |||
public ComponentWsRequest setDeveloperKey(@Nullable String developerKey) { | |||
public ComponentRequest setDeveloperKey(@Nullable String developerKey) { | |||
this.developerKey = developerKey; | |||
return this; | |||
} |
@@ -23,7 +23,7 @@ import java.util.List; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class ComponentTreeWsRequest { | |||
public class ComponentTreeRequest { | |||
private String baseComponentId; | |||
private String baseComponentKey; | |||
@@ -57,7 +57,7 @@ public class ComponentTreeWsRequest { | |||
* @deprecated since 6.6, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public ComponentTreeWsRequest setBaseComponentId(@Nullable String baseComponentId) { | |||
public ComponentTreeRequest setBaseComponentId(@Nullable String baseComponentId) { | |||
this.baseComponentId = baseComponentId; | |||
return this; | |||
} | |||
@@ -75,7 +75,7 @@ public class ComponentTreeWsRequest { | |||
* @deprecated since 6.6, please use {@link #setComponent(String)} instead | |||
*/ | |||
@Deprecated | |||
public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { | |||
public ComponentTreeRequest setBaseComponentKey(@Nullable String baseComponentKey) { | |||
this.baseComponentKey = baseComponentKey; | |||
return this; | |||
} | |||
@@ -85,7 +85,7 @@ public class ComponentTreeWsRequest { | |||
return component; | |||
} | |||
public ComponentTreeWsRequest setComponent(@Nullable String component) { | |||
public ComponentTreeRequest setComponent(@Nullable String component) { | |||
this.component = component; | |||
return this; | |||
} | |||
@@ -95,7 +95,7 @@ public class ComponentTreeWsRequest { | |||
return branch; | |||
} | |||
public ComponentTreeWsRequest setBranch(@Nullable String branch) { | |||
public ComponentTreeRequest setBranch(@Nullable String branch) { | |||
this.branch = branch; | |||
return this; | |||
} | |||
@@ -105,7 +105,7 @@ public class ComponentTreeWsRequest { | |||
return strategy; | |||
} | |||
public ComponentTreeWsRequest setStrategy(String strategy) { | |||
public ComponentTreeRequest setStrategy(String strategy) { | |||
this.strategy = strategy; | |||
return this; | |||
} | |||
@@ -115,7 +115,7 @@ public class ComponentTreeWsRequest { | |||
return qualifiers; | |||
} | |||
public ComponentTreeWsRequest setQualifiers(@Nullable List<String> qualifiers) { | |||
public ComponentTreeRequest setQualifiers(@Nullable List<String> qualifiers) { | |||
this.qualifiers = qualifiers; | |||
return this; | |||
} | |||
@@ -125,7 +125,7 @@ public class ComponentTreeWsRequest { | |||
return additionalFields; | |||
} | |||
public ComponentTreeWsRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
public ComponentTreeRequest setAdditionalFields(@Nullable List<String> additionalFields) { | |||
this.additionalFields = additionalFields; | |||
return this; | |||
} | |||
@@ -135,7 +135,7 @@ public class ComponentTreeWsRequest { | |||
return query; | |||
} | |||
public ComponentTreeWsRequest setQuery(@Nullable String query) { | |||
public ComponentTreeRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -145,7 +145,7 @@ public class ComponentTreeWsRequest { | |||
return sort; | |||
} | |||
public ComponentTreeWsRequest setSort(@Nullable List<String> sort) { | |||
public ComponentTreeRequest setSort(@Nullable List<String> sort) { | |||
this.sort = sort; | |||
return this; | |||
} | |||
@@ -155,7 +155,7 @@ public class ComponentTreeWsRequest { | |||
return metricSort; | |||
} | |||
public ComponentTreeWsRequest setMetricSort(@Nullable String metricSort) { | |||
public ComponentTreeRequest setMetricSort(@Nullable String metricSort) { | |||
this.metricSort = metricSort; | |||
return this; | |||
} | |||
@@ -165,7 +165,7 @@ public class ComponentTreeWsRequest { | |||
return metricSortFilter; | |||
} | |||
public ComponentTreeWsRequest setMetricSortFilter(@Nullable String metricSortFilter) { | |||
public ComponentTreeRequest setMetricSortFilter(@Nullable String metricSortFilter) { | |||
this.metricSortFilter = metricSortFilter; | |||
return this; | |||
} | |||
@@ -175,7 +175,7 @@ public class ComponentTreeWsRequest { | |||
return metricKeys; | |||
} | |||
public ComponentTreeWsRequest setMetricKeys(List<String> metricKeys) { | |||
public ComponentTreeRequest setMetricKeys(List<String> metricKeys) { | |||
this.metricKeys = metricKeys; | |||
return this; | |||
} | |||
@@ -185,7 +185,7 @@ public class ComponentTreeWsRequest { | |||
return asc; | |||
} | |||
public ComponentTreeWsRequest setAsc(@Nullable Boolean asc) { | |||
public ComponentTreeRequest setAsc(@Nullable Boolean asc) { | |||
this.asc = asc; | |||
return this; | |||
} | |||
@@ -195,7 +195,7 @@ public class ComponentTreeWsRequest { | |||
return page; | |||
} | |||
public ComponentTreeWsRequest setPage(int page) { | |||
public ComponentTreeRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -205,7 +205,7 @@ public class ComponentTreeWsRequest { | |||
return pageSize; | |||
} | |||
public ComponentTreeWsRequest setPageSize(int pageSize) { | |||
public ComponentTreeRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} | |||
@@ -215,7 +215,7 @@ public class ComponentTreeWsRequest { | |||
return metricPeriodSort; | |||
} | |||
public ComponentTreeWsRequest setMetricPeriodSort(@Nullable Integer metricPeriodSort) { | |||
public ComponentTreeRequest setMetricPeriodSort(@Nullable Integer metricPeriodSort) { | |||
this.metricPeriodSort = metricPeriodSort; | |||
return this; | |||
} | |||
@@ -225,7 +225,7 @@ public class ComponentTreeWsRequest { | |||
return developerId; | |||
} | |||
public ComponentTreeWsRequest setDeveloperId(@Nullable String developerId) { | |||
public ComponentTreeRequest setDeveloperId(@Nullable String developerId) { | |||
this.developerId = developerId; | |||
return this; | |||
} | |||
@@ -235,7 +235,7 @@ public class ComponentTreeWsRequest { | |||
return developerKey; | |||
} | |||
public ComponentTreeWsRequest setDeveloperKey(@Nullable String developerKey) { | |||
public ComponentTreeRequest setDeveloperKey(@Nullable String developerKey) { | |||
this.developerKey = developerKey; | |||
return this; | |||
} |
@@ -56,7 +56,7 @@ public class MeasuresService extends BaseService { | |||
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()) | |||
@@ -79,7 +79,7 @@ public class MeasuresService extends BaseService { | |||
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()) |
@@ -22,14 +22,14 @@ package org.sonarqube.ws.client.organization; | |||
import javax.annotation.concurrent.Immutable; | |||
@Immutable | |||
public class CreateWsRequest { | |||
public class CreateRequest { | |||
private final String name; | |||
private final String key; | |||
private final String description; | |||
private final String url; | |||
private final String avatar; | |||
private CreateWsRequest(Builder builder) { | |||
private CreateRequest(Builder builder) { | |||
this.name = builder.name; | |||
this.key = builder.key; | |||
this.description = builder.description; | |||
@@ -93,8 +93,8 @@ public class CreateWsRequest { | |||
return this; | |||
} | |||
public CreateWsRequest build() { | |||
return new CreateWsRequest(this); | |||
public CreateRequest build() { | |||
return new CreateRequest(this); | |||
} | |||
} | |||
} |
@@ -40,7 +40,7 @@ public class OrganizationService extends BaseService { | |||
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()) | |||
@@ -49,7 +49,7 @@ public class OrganizationService extends BaseService { | |||
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()) | |||
@@ -60,7 +60,7 @@ public class OrganizationService extends BaseService { | |||
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()) | |||
@@ -78,7 +78,7 @@ public class OrganizationService extends BaseService { | |||
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()) | |||
@@ -105,7 +105,7 @@ public class OrganizationService extends BaseService { | |||
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()); |
@@ -23,7 +23,7 @@ package org.sonarqube.ws.client.organization; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SearchMembersWsRequest { | |||
public class SearchMembersRequest { | |||
private String organization; | |||
private String selected; | |||
private String query; | |||
@@ -35,7 +35,7 @@ public class SearchMembersWsRequest { | |||
return organization; | |||
} | |||
public SearchMembersWsRequest setOrganization(@Nullable String organization) { | |||
public SearchMembersRequest setOrganization(@Nullable String organization) { | |||
this.organization = organization; | |||
return this; | |||
} | |||
@@ -45,7 +45,7 @@ public class SearchMembersWsRequest { | |||
return selected; | |||
} | |||
public SearchMembersWsRequest setSelected(@Nullable String selected) { | |||
public SearchMembersRequest setSelected(@Nullable String selected) { | |||
this.selected = selected; | |||
return this; | |||
} | |||
@@ -55,7 +55,7 @@ public class SearchMembersWsRequest { | |||
return query; | |||
} | |||
public SearchMembersWsRequest setQuery(@Nullable String query) { | |||
public SearchMembersRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -65,7 +65,7 @@ public class SearchMembersWsRequest { | |||
return page; | |||
} | |||
public SearchMembersWsRequest setPage(@Nullable Integer page) { | |||
public SearchMembersRequest setPage(@Nullable Integer page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -75,7 +75,7 @@ public class SearchMembersWsRequest { | |||
return pageSize; | |||
} | |||
public SearchMembersWsRequest setPageSize(@Nullable Integer pageSize) { | |||
public SearchMembersRequest setPageSize(@Nullable Integer pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} |
@@ -27,12 +27,12 @@ import javax.annotation.concurrent.Immutable; | |||
import static java.util.Arrays.asList; | |||
@Immutable | |||
public class SearchWsRequest { | |||
public class SearchRequest { | |||
private final Integer page; | |||
private final Integer pageSize; | |||
private final List<String> organizations; | |||
private SearchWsRequest(Builder builder) { | |||
private SearchRequest(Builder builder) { | |||
this.page = builder.page; | |||
this.pageSize = builder.pageSize; | |||
this.organizations = builder.organizations; | |||
@@ -77,8 +77,8 @@ public class SearchWsRequest { | |||
return this; | |||
} | |||
public SearchWsRequest build() { | |||
return new SearchWsRequest(this); | |||
public SearchRequest build() { | |||
return new SearchRequest(this); | |||
} | |||
} | |||
} |
@@ -24,11 +24,11 @@ import javax.annotation.Nullable; | |||
import javax.annotation.concurrent.Immutable; | |||
@Immutable | |||
public class UpdateProjectVisibilityWsRequest { | |||
public class UpdateProjectVisibilityRequest { | |||
private final String organization; | |||
private final String projectVisibility; | |||
private UpdateProjectVisibilityWsRequest(Builder builder) { | |||
private UpdateProjectVisibilityRequest(Builder builder) { | |||
this.organization = builder.organization; | |||
this.projectVisibility = builder.projectVisibility; | |||
} | |||
@@ -61,8 +61,8 @@ public class UpdateProjectVisibilityWsRequest { | |||
return this; | |||
} | |||
public UpdateProjectVisibilityWsRequest build() { | |||
return new UpdateProjectVisibilityWsRequest(this); | |||
public UpdateProjectVisibilityRequest build() { | |||
return new UpdateProjectVisibilityRequest(this); | |||
} | |||
} | |||
} |
@@ -24,14 +24,14 @@ import javax.annotation.Nullable; | |||
import javax.annotation.concurrent.Immutable; | |||
@Immutable | |||
public class UpdateWsRequest { | |||
public class UpdateRequest { | |||
private final String key; | |||
private final String name; | |||
private final String description; | |||
private final String url; | |||
private final String avatar; | |||
private UpdateWsRequest(Builder builder) { | |||
private UpdateRequest(Builder builder) { | |||
this.name = builder.name; | |||
this.key = builder.key; | |||
this.description = builder.description; | |||
@@ -96,8 +96,8 @@ public class UpdateWsRequest { | |||
return this; | |||
} | |||
public UpdateWsRequest build() { | |||
return new UpdateWsRequest(this); | |||
public UpdateRequest build() { | |||
return new UpdateRequest(this); | |||
} | |||
} | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class AddGroupWsRequest { | |||
public class AddGroupRequest { | |||
private String permission; | |||
private String groupId; | |||
private String organization; | |||
@@ -36,7 +36,7 @@ public class AddGroupWsRequest { | |||
return permission; | |||
} | |||
public AddGroupWsRequest setPermission(String permission) { | |||
public AddGroupRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission, "permission must not be null"); | |||
return this; | |||
} | |||
@@ -46,7 +46,7 @@ public class AddGroupWsRequest { | |||
return groupId; | |||
} | |||
public AddGroupWsRequest setGroupId(@Nullable String groupId) { | |||
public AddGroupRequest setGroupId(@Nullable String groupId) { | |||
this.groupId = groupId; | |||
return this; | |||
} | |||
@@ -56,7 +56,7 @@ public class AddGroupWsRequest { | |||
return organization; | |||
} | |||
public AddGroupWsRequest setOrganization(@Nullable String s) { | |||
public AddGroupRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -66,7 +66,7 @@ public class AddGroupWsRequest { | |||
return groupName; | |||
} | |||
public AddGroupWsRequest setGroupName(@Nullable String groupName) { | |||
public AddGroupRequest setGroupName(@Nullable String groupName) { | |||
this.groupName = groupName; | |||
return this; | |||
} | |||
@@ -76,7 +76,7 @@ public class AddGroupWsRequest { | |||
return projectId; | |||
} | |||
public AddGroupWsRequest setProjectId(@Nullable String projectId) { | |||
public AddGroupRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -86,7 +86,7 @@ public class AddGroupWsRequest { | |||
return projectKey; | |||
} | |||
public AddGroupWsRequest setProjectKey(@Nullable String projectKey) { | |||
public AddGroupRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class AddGroupToTemplateWsRequest { | |||
public class AddGroupToTemplateRequest { | |||
private String groupId; | |||
private String groupName; | |||
private String permission; | |||
@@ -36,7 +36,7 @@ public class AddGroupToTemplateWsRequest { | |||
return groupId; | |||
} | |||
public AddGroupToTemplateWsRequest setGroupId(@Nullable String groupId) { | |||
public AddGroupToTemplateRequest setGroupId(@Nullable String groupId) { | |||
this.groupId = groupId; | |||
return this; | |||
} | |||
@@ -46,7 +46,7 @@ public class AddGroupToTemplateWsRequest { | |||
return groupName; | |||
} | |||
public AddGroupToTemplateWsRequest setGroupName(@Nullable String groupName) { | |||
public AddGroupToTemplateRequest setGroupName(@Nullable String groupName) { | |||
this.groupName = groupName; | |||
return this; | |||
} | |||
@@ -55,7 +55,7 @@ public class AddGroupToTemplateWsRequest { | |||
return permission; | |||
} | |||
public AddGroupToTemplateWsRequest setPermission(String permission) { | |||
public AddGroupToTemplateRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission, "permission must not be null"); | |||
return this; | |||
} | |||
@@ -65,7 +65,7 @@ public class AddGroupToTemplateWsRequest { | |||
return templateId; | |||
} | |||
public AddGroupToTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public AddGroupToTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -75,7 +75,7 @@ public class AddGroupToTemplateWsRequest { | |||
return templateName; | |||
} | |||
public AddGroupToTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public AddGroupToTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -26,13 +26,13 @@ import javax.annotation.concurrent.Immutable; | |||
import static java.util.Objects.requireNonNull; | |||
@Immutable | |||
public class AddProjectCreatorToTemplateWsRequest { | |||
public class AddProjectCreatorToTemplateRequest { | |||
private final String templateId; | |||
private final String organization; | |||
private final String templateName; | |||
private final String permission; | |||
private AddProjectCreatorToTemplateWsRequest(Builder builder) { | |||
private AddProjectCreatorToTemplateRequest(Builder builder) { | |||
this.templateId = builder.templateId; | |||
this.organization = builder.organization; | |||
this.templateName = builder.templateName; | |||
@@ -92,8 +92,8 @@ public class AddProjectCreatorToTemplateWsRequest { | |||
return this; | |||
} | |||
public AddProjectCreatorToTemplateWsRequest build() { | |||
return new AddProjectCreatorToTemplateWsRequest(this); | |||
public AddProjectCreatorToTemplateRequest build() { | |||
return new AddProjectCreatorToTemplateRequest(this); | |||
} | |||
} | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class AddUserWsRequest { | |||
public class AddUserRequest { | |||
private String login; | |||
private String permission; | |||
private String projectId; | |||
@@ -35,7 +35,7 @@ public class AddUserWsRequest { | |||
return login; | |||
} | |||
public AddUserWsRequest setLogin(String login) { | |||
public AddUserRequest setLogin(String login) { | |||
this.login = requireNonNull(login, "login must not be null"); | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class AddUserWsRequest { | |||
return permission; | |||
} | |||
public AddUserWsRequest setPermission(String permission) { | |||
public AddUserRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission, "permission must not be null"); | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class AddUserWsRequest { | |||
return projectId; | |||
} | |||
public AddUserWsRequest setProjectId(@Nullable String projectId) { | |||
public AddUserRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class AddUserWsRequest { | |||
return projectKey; | |||
} | |||
public AddUserWsRequest setProjectKey(@Nullable String projectKey) { | |||
public AddUserRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@@ -74,7 +74,7 @@ public class AddUserWsRequest { | |||
return organization; | |||
} | |||
public AddUserWsRequest setOrganization(@Nullable String s) { | |||
public AddUserRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class AddUserToTemplateWsRequest { | |||
public class AddUserToTemplateRequest { | |||
private String login; | |||
private String permission; | |||
private String templateId; | |||
@@ -35,7 +35,7 @@ public class AddUserToTemplateWsRequest { | |||
return login; | |||
} | |||
public AddUserToTemplateWsRequest setLogin(String login) { | |||
public AddUserToTemplateRequest setLogin(String login) { | |||
this.login = requireNonNull(login); | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class AddUserToTemplateWsRequest { | |||
return permission; | |||
} | |||
public AddUserToTemplateWsRequest setPermission(String permission) { | |||
public AddUserToTemplateRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission); | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class AddUserToTemplateWsRequest { | |||
return templateId; | |||
} | |||
public AddUserToTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public AddUserToTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class AddUserToTemplateWsRequest { | |||
return templateName; | |||
} | |||
public AddUserToTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public AddUserToTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} | |||
@@ -74,7 +74,7 @@ public class AddUserToTemplateWsRequest { | |||
return organization; | |||
} | |||
public AddUserToTemplateWsRequest setOrganization(@Nullable String s) { | |||
public AddUserToTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class ApplyTemplateWsRequest { | |||
public class ApplyTemplateRequest { | |||
private String projectId; | |||
private String projectKey; | |||
private String templateId; | |||
@@ -34,7 +34,7 @@ public class ApplyTemplateWsRequest { | |||
return projectId; | |||
} | |||
public ApplyTemplateWsRequest setProjectId(@Nullable String projectId) { | |||
public ApplyTemplateRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class ApplyTemplateWsRequest { | |||
return projectKey; | |||
} | |||
public ApplyTemplateWsRequest setProjectKey(@Nullable String projectKey) { | |||
public ApplyTemplateRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class ApplyTemplateWsRequest { | |||
return templateId; | |||
} | |||
public ApplyTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public ApplyTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class ApplyTemplateWsRequest { | |||
return organization; | |||
} | |||
public ApplyTemplateWsRequest setOrganization(@Nullable String s) { | |||
public ApplyTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -73,7 +73,7 @@ public class ApplyTemplateWsRequest { | |||
return templateName; | |||
} | |||
public ApplyTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public ApplyTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -27,7 +27,7 @@ import org.sonar.api.resources.Qualifiers; | |||
import static java.util.Collections.singleton; | |||
import static java.util.Objects.requireNonNull; | |||
public class BulkApplyTemplateWsRequest { | |||
public class BulkApplyTemplateRequest { | |||
private String templateId; | |||
private String organization; | |||
private String templateName; | |||
@@ -43,7 +43,7 @@ public class BulkApplyTemplateWsRequest { | |||
return templateId; | |||
} | |||
public BulkApplyTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public BulkApplyTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -53,7 +53,7 @@ public class BulkApplyTemplateWsRequest { | |||
return organization; | |||
} | |||
public BulkApplyTemplateWsRequest setOrganization(@Nullable String s) { | |||
public BulkApplyTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -63,7 +63,7 @@ public class BulkApplyTemplateWsRequest { | |||
return templateName; | |||
} | |||
public BulkApplyTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public BulkApplyTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} | |||
@@ -73,7 +73,7 @@ public class BulkApplyTemplateWsRequest { | |||
return query; | |||
} | |||
public BulkApplyTemplateWsRequest setQuery(@Nullable String query) { | |||
public BulkApplyTemplateRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -82,7 +82,7 @@ public class BulkApplyTemplateWsRequest { | |||
return qualifiers; | |||
} | |||
public BulkApplyTemplateWsRequest setQualifiers(Collection<String> qualifiers) { | |||
public BulkApplyTemplateRequest setQualifiers(Collection<String> qualifiers) { | |||
this.qualifiers = requireNonNull(qualifiers); | |||
return this; | |||
} | |||
@@ -92,7 +92,7 @@ public class BulkApplyTemplateWsRequest { | |||
return visibility; | |||
} | |||
public BulkApplyTemplateWsRequest setVisibility(@Nullable String visibility) { | |||
public BulkApplyTemplateRequest setVisibility(@Nullable String visibility) { | |||
this.visibility = visibility; | |||
return this; | |||
} | |||
@@ -102,7 +102,7 @@ public class BulkApplyTemplateWsRequest { | |||
return analyzedBefore; | |||
} | |||
public BulkApplyTemplateWsRequest setAnalyzedBefore(@Nullable String analyzedBefore) { | |||
public BulkApplyTemplateRequest setAnalyzedBefore(@Nullable String analyzedBefore) { | |||
this.analyzedBefore = analyzedBefore; | |||
return this; | |||
} | |||
@@ -111,7 +111,7 @@ public class BulkApplyTemplateWsRequest { | |||
return onProvisionedOnly; | |||
} | |||
public BulkApplyTemplateWsRequest setOnProvisionedOnly(boolean onProvisionedOnly) { | |||
public BulkApplyTemplateRequest setOnProvisionedOnly(boolean onProvisionedOnly) { | |||
this.onProvisionedOnly = onProvisionedOnly; | |||
return this; | |||
} | |||
@@ -121,7 +121,7 @@ public class BulkApplyTemplateWsRequest { | |||
return projects; | |||
} | |||
public BulkApplyTemplateWsRequest setProjects(@Nullable Collection<String> projects) { | |||
public BulkApplyTemplateRequest setProjects(@Nullable Collection<String> projects) { | |||
this.projects = projects; | |||
return this; | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class CreateTemplateWsRequest { | |||
public class CreateTemplateRequest { | |||
private String description; | |||
private String name; | |||
private String projectKeyPattern; | |||
@@ -35,7 +35,7 @@ public class CreateTemplateWsRequest { | |||
return description; | |||
} | |||
public CreateTemplateWsRequest setDescription(@Nullable String description) { | |||
public CreateTemplateRequest setDescription(@Nullable String description) { | |||
this.description = description; | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class CreateTemplateWsRequest { | |||
return name; | |||
} | |||
public CreateTemplateWsRequest setName(String name) { | |||
public CreateTemplateRequest setName(String name) { | |||
this.name = requireNonNull(name); | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class CreateTemplateWsRequest { | |||
return projectKeyPattern; | |||
} | |||
public CreateTemplateWsRequest setProjectKeyPattern(@Nullable String projectKeyPattern) { | |||
public CreateTemplateRequest setProjectKeyPattern(@Nullable String projectKeyPattern) { | |||
this.projectKeyPattern = projectKeyPattern; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class CreateTemplateWsRequest { | |||
return organization; | |||
} | |||
public CreateTemplateWsRequest setOrganization(@Nullable String s) { | |||
public CreateTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class DeleteTemplateWsRequest { | |||
public class DeleteTemplateRequest { | |||
private String templateId; | |||
private String organization; | |||
private String templateName; | |||
@@ -32,7 +32,7 @@ public class DeleteTemplateWsRequest { | |||
return templateId; | |||
} | |||
public DeleteTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public DeleteTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -42,7 +42,7 @@ public class DeleteTemplateWsRequest { | |||
return organization; | |||
} | |||
public DeleteTemplateWsRequest setOrganization(@Nullable String s) { | |||
public DeleteTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -52,7 +52,7 @@ public class DeleteTemplateWsRequest { | |||
return templateName; | |||
} | |||
public DeleteTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public DeleteTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class GroupsWsRequest { | |||
public class GroupsRequest { | |||
private String permission; | |||
private String projectId; | |||
private String projectKey; | |||
@@ -35,7 +35,7 @@ public class GroupsWsRequest { | |||
return permission; | |||
} | |||
public GroupsWsRequest setPermission(@Nullable String permission) { | |||
public GroupsRequest setPermission(@Nullable String permission) { | |||
this.permission = permission; | |||
return this; | |||
} | |||
@@ -45,7 +45,7 @@ public class GroupsWsRequest { | |||
return projectId; | |||
} | |||
public GroupsWsRequest setProjectId(@Nullable String projectId) { | |||
public GroupsRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -55,7 +55,7 @@ public class GroupsWsRequest { | |||
return projectKey; | |||
} | |||
public GroupsWsRequest setProjectKey(String projectKey) { | |||
public GroupsRequest setProjectKey(String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@@ -65,7 +65,7 @@ public class GroupsWsRequest { | |||
return page; | |||
} | |||
public GroupsWsRequest setPage(int page) { | |||
public GroupsRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -75,7 +75,7 @@ public class GroupsWsRequest { | |||
return pageSize; | |||
} | |||
public GroupsWsRequest setPageSize(int pageSize) { | |||
public GroupsRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} | |||
@@ -85,7 +85,7 @@ public class GroupsWsRequest { | |||
return query; | |||
} | |||
public GroupsWsRequest setQuery(@Nullable String query) { | |||
public GroupsRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} |
@@ -53,7 +53,7 @@ public class PermissionsService extends BaseService { | |||
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()) | |||
@@ -64,7 +64,7 @@ public class PermissionsService extends BaseService { | |||
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()) | |||
@@ -74,7 +74,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -83,7 +83,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -92,7 +92,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -101,7 +101,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -109,7 +109,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -118,7 +118,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -131,7 +131,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -140,14 +140,14 @@ public class PermissionsService extends BaseService { | |||
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()) | |||
@@ -157,7 +157,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -167,7 +167,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -176,7 +176,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -184,7 +184,7 @@ public class PermissionsService extends BaseService { | |||
.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()) | |||
@@ -198,7 +198,7 @@ public class PermissionsService extends BaseService { | |||
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()) | |||
@@ -209,20 +209,20 @@ public class PermissionsService extends BaseService { | |||
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()) | |||
@@ -230,7 +230,7 @@ public class PermissionsService extends BaseService { | |||
.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()) |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class RemoveGroupFromTemplateWsRequest { | |||
public class RemoveGroupFromTemplateRequest { | |||
private String organization; | |||
private String permission; | |||
private String groupId; | |||
@@ -36,7 +36,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return permission; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setPermission(String permission) { | |||
public RemoveGroupFromTemplateRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission); | |||
return this; | |||
} | |||
@@ -46,7 +46,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return organization; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setOrganization(@Nullable String s) { | |||
public RemoveGroupFromTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -56,7 +56,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return groupId; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setGroupId(@Nullable String groupId) { | |||
public RemoveGroupFromTemplateRequest setGroupId(@Nullable String groupId) { | |||
this.groupId = groupId; | |||
return this; | |||
} | |||
@@ -66,7 +66,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return groupName; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setGroupName(@Nullable String groupName) { | |||
public RemoveGroupFromTemplateRequest setGroupName(@Nullable String groupName) { | |||
this.groupName = groupName; | |||
return this; | |||
} | |||
@@ -76,7 +76,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return templateId; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public RemoveGroupFromTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -86,7 +86,7 @@ public class RemoveGroupFromTemplateWsRequest { | |||
return templateName; | |||
} | |||
public RemoveGroupFromTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public RemoveGroupFromTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class RemoveGroupWsRequest { | |||
public class RemoveGroupRequest { | |||
private String organization; | |||
private String groupId; | |||
private String groupName; | |||
@@ -35,7 +35,7 @@ public class RemoveGroupWsRequest { | |||
return organization; | |||
} | |||
public RemoveGroupWsRequest setOrganization(@Nullable String s) { | |||
public RemoveGroupRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -45,7 +45,7 @@ public class RemoveGroupWsRequest { | |||
return groupId; | |||
} | |||
public RemoveGroupWsRequest setGroupId(@Nullable String groupId) { | |||
public RemoveGroupRequest setGroupId(@Nullable String groupId) { | |||
this.groupId = groupId; | |||
return this; | |||
} | |||
@@ -55,7 +55,7 @@ public class RemoveGroupWsRequest { | |||
return groupName; | |||
} | |||
public RemoveGroupWsRequest setGroupName(@Nullable String groupName) { | |||
public RemoveGroupRequest setGroupName(@Nullable String groupName) { | |||
this.groupName = groupName; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class RemoveGroupWsRequest { | |||
return permission; | |||
} | |||
public RemoveGroupWsRequest setPermission(String permission) { | |||
public RemoveGroupRequest setPermission(String permission) { | |||
this.permission = permission; | |||
return this; | |||
} | |||
@@ -74,7 +74,7 @@ public class RemoveGroupWsRequest { | |||
return projectId; | |||
} | |||
public RemoveGroupWsRequest setProjectId(@Nullable String projectId) { | |||
public RemoveGroupRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -84,7 +84,7 @@ public class RemoveGroupWsRequest { | |||
return projectKey; | |||
} | |||
public RemoveGroupWsRequest setProjectKey(@Nullable String projectKey) { | |||
public RemoveGroupRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} |
@@ -26,13 +26,13 @@ import javax.annotation.concurrent.Immutable; | |||
import static java.util.Objects.requireNonNull; | |||
@Immutable | |||
public class RemoveProjectCreatorFromTemplateWsRequest { | |||
public class RemoveProjectCreatorFromTemplateRequest { | |||
private final String templateId; | |||
private final String organization; | |||
private final String templateName; | |||
private final String permission; | |||
private RemoveProjectCreatorFromTemplateWsRequest(Builder builder) { | |||
private RemoveProjectCreatorFromTemplateRequest(Builder builder) { | |||
this.templateId = builder.templateId; | |||
this.organization = builder.organization; | |||
this.templateName = builder.templateName; | |||
@@ -92,8 +92,8 @@ public class RemoveProjectCreatorFromTemplateWsRequest { | |||
return this; | |||
} | |||
public RemoveProjectCreatorFromTemplateWsRequest build() { | |||
return new RemoveProjectCreatorFromTemplateWsRequest(this); | |||
public RemoveProjectCreatorFromTemplateRequest build() { | |||
return new RemoveProjectCreatorFromTemplateRequest(this); | |||
} | |||
} | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class RemoveUserFromTemplateWsRequest { | |||
public class RemoveUserFromTemplateRequest { | |||
private String login; | |||
private String permission; | |||
private String templateId; | |||
@@ -35,7 +35,7 @@ public class RemoveUserFromTemplateWsRequest { | |||
return login; | |||
} | |||
public RemoveUserFromTemplateWsRequest setLogin(String login) { | |||
public RemoveUserFromTemplateRequest setLogin(String login) { | |||
this.login = requireNonNull(login); | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class RemoveUserFromTemplateWsRequest { | |||
return permission; | |||
} | |||
public RemoveUserFromTemplateWsRequest setPermission(String permission) { | |||
public RemoveUserFromTemplateRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission); | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class RemoveUserFromTemplateWsRequest { | |||
return templateId; | |||
} | |||
public RemoveUserFromTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public RemoveUserFromTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class RemoveUserFromTemplateWsRequest { | |||
return organization; | |||
} | |||
public RemoveUserFromTemplateWsRequest setOrganization(@Nullable String s) { | |||
public RemoveUserFromTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -74,7 +74,7 @@ public class RemoveUserFromTemplateWsRequest { | |||
return templateName; | |||
} | |||
public RemoveUserFromTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public RemoveUserFromTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class RemoveUserWsRequest { | |||
public class RemoveUserRequest { | |||
private String permission; | |||
private String login; | |||
private String projectId; | |||
@@ -34,7 +34,7 @@ public class RemoveUserWsRequest { | |||
return permission; | |||
} | |||
public RemoveUserWsRequest setPermission(String permission) { | |||
public RemoveUserRequest setPermission(String permission) { | |||
this.permission = requireNonNull(permission); | |||
return this; | |||
} | |||
@@ -43,7 +43,7 @@ public class RemoveUserWsRequest { | |||
return login; | |||
} | |||
public RemoveUserWsRequest setLogin(String login) { | |||
public RemoveUserRequest setLogin(String login) { | |||
this.login = requireNonNull(login); | |||
return this; | |||
} | |||
@@ -53,7 +53,7 @@ public class RemoveUserWsRequest { | |||
return projectId; | |||
} | |||
public RemoveUserWsRequest setProjectId(@Nullable String projectId) { | |||
public RemoveUserRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -63,7 +63,7 @@ public class RemoveUserWsRequest { | |||
return projectKey; | |||
} | |||
public RemoveUserWsRequest setProjectKey(@Nullable String projectKey) { | |||
public RemoveUserRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SearchProjectPermissionsWsRequest { | |||
public class SearchProjectPermissionsRequest { | |||
private String projectId; | |||
private String projectKey; | |||
private String qualifier; | |||
@@ -35,7 +35,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return projectId; | |||
} | |||
public SearchProjectPermissionsWsRequest setProjectId(@Nullable String projectId) { | |||
public SearchProjectPermissionsRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -45,7 +45,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return projectKey; | |||
} | |||
public SearchProjectPermissionsWsRequest setProjectKey(@Nullable String projectKey) { | |||
public SearchProjectPermissionsRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@@ -55,7 +55,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return page; | |||
} | |||
public SearchProjectPermissionsWsRequest setPage(int page) { | |||
public SearchProjectPermissionsRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -65,7 +65,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return pageSize; | |||
} | |||
public SearchProjectPermissionsWsRequest setPageSize(int pageSize) { | |||
public SearchProjectPermissionsRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} | |||
@@ -75,7 +75,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return query; | |||
} | |||
public SearchProjectPermissionsWsRequest setQuery(@Nullable String query) { | |||
public SearchProjectPermissionsRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -85,7 +85,7 @@ public class SearchProjectPermissionsWsRequest { | |||
return qualifier; | |||
} | |||
public SearchProjectPermissionsWsRequest setQualifier(@Nullable String qualifier) { | |||
public SearchProjectPermissionsRequest setQualifier(@Nullable String qualifier) { | |||
this.qualifier = qualifier; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SearchTemplatesWsRequest { | |||
public class SearchTemplatesRequest { | |||
private String query; | |||
private String organizationUuid; | |||
@@ -31,7 +31,7 @@ public class SearchTemplatesWsRequest { | |||
return query; | |||
} | |||
public SearchTemplatesWsRequest setQuery(@Nullable String query) { | |||
public SearchTemplatesRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -40,7 +40,7 @@ public class SearchTemplatesWsRequest { | |||
return organizationUuid; | |||
} | |||
public SearchTemplatesWsRequest setOrganizationUuid(String s) { | |||
public SearchTemplatesRequest setOrganizationUuid(String s) { | |||
this.organizationUuid = s; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SetDefaultTemplateWsRequest { | |||
public class SetDefaultTemplateRequest { | |||
private String qualifier; | |||
private String templateId; | |||
private String organization; | |||
@@ -33,7 +33,7 @@ public class SetDefaultTemplateWsRequest { | |||
return qualifier; | |||
} | |||
public SetDefaultTemplateWsRequest setQualifier(@Nullable String qualifier) { | |||
public SetDefaultTemplateRequest setQualifier(@Nullable String qualifier) { | |||
this.qualifier = qualifier; | |||
return this; | |||
} | |||
@@ -43,7 +43,7 @@ public class SetDefaultTemplateWsRequest { | |||
return templateId; | |||
} | |||
public SetDefaultTemplateWsRequest setTemplateId(@Nullable String templateId) { | |||
public SetDefaultTemplateRequest setTemplateId(@Nullable String templateId) { | |||
this.templateId = templateId; | |||
return this; | |||
} | |||
@@ -53,7 +53,7 @@ public class SetDefaultTemplateWsRequest { | |||
return organization; | |||
} | |||
public SetDefaultTemplateWsRequest setOrganization(@Nullable String s) { | |||
public SetDefaultTemplateRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -63,7 +63,7 @@ public class SetDefaultTemplateWsRequest { | |||
return templateName; | |||
} | |||
public SetDefaultTemplateWsRequest setTemplateName(@Nullable String templateName) { | |||
public SetDefaultTemplateRequest setTemplateName(@Nullable String templateName) { | |||
this.templateName = templateName; | |||
return this; | |||
} |
@@ -24,7 +24,7 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class UpdateTemplateWsRequest { | |||
public class UpdateTemplateRequest { | |||
private String id; | |||
private String description; | |||
private String name; | |||
@@ -34,7 +34,7 @@ public class UpdateTemplateWsRequest { | |||
return id; | |||
} | |||
public UpdateTemplateWsRequest setId(String id) { | |||
public UpdateTemplateRequest setId(String id) { | |||
this.id = requireNonNull(id); | |||
return this; | |||
} | |||
@@ -44,7 +44,7 @@ public class UpdateTemplateWsRequest { | |||
return description; | |||
} | |||
public UpdateTemplateWsRequest setDescription(@Nullable String description) { | |||
public UpdateTemplateRequest setDescription(@Nullable String description) { | |||
this.description = description; | |||
return this; | |||
} | |||
@@ -54,7 +54,7 @@ public class UpdateTemplateWsRequest { | |||
return name; | |||
} | |||
public UpdateTemplateWsRequest setName(@Nullable String name) { | |||
public UpdateTemplateRequest setName(@Nullable String name) { | |||
this.name = name; | |||
return this; | |||
} | |||
@@ -64,7 +64,7 @@ public class UpdateTemplateWsRequest { | |||
return projectKeyPattern; | |||
} | |||
public UpdateTemplateWsRequest setProjectKeyPattern(@Nullable String projectKeyPattern) { | |||
public UpdateTemplateRequest setProjectKeyPattern(@Nullable String projectKeyPattern) { | |||
this.projectKeyPattern = projectKeyPattern; | |||
return this; | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.permission; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class UsersWsRequest { | |||
public class UsersRequest { | |||
private String organization; | |||
private String permission; | |||
private String projectId; | |||
@@ -36,7 +36,7 @@ public class UsersWsRequest { | |||
return organization; | |||
} | |||
public UsersWsRequest setOrganization(@Nullable String s) { | |||
public UsersRequest setOrganization(@Nullable String s) { | |||
this.organization = s; | |||
return this; | |||
} | |||
@@ -46,7 +46,7 @@ public class UsersWsRequest { | |||
return permission; | |||
} | |||
public UsersWsRequest setPermission(@Nullable String permission) { | |||
public UsersRequest setPermission(@Nullable String permission) { | |||
this.permission = permission; | |||
return this; | |||
} | |||
@@ -56,7 +56,7 @@ public class UsersWsRequest { | |||
return projectId; | |||
} | |||
public UsersWsRequest setProjectId(@Nullable String projectId) { | |||
public UsersRequest setProjectId(@Nullable String projectId) { | |||
this.projectId = projectId; | |||
return this; | |||
} | |||
@@ -66,7 +66,7 @@ public class UsersWsRequest { | |||
return projectKey; | |||
} | |||
public UsersWsRequest setProjectKey(@Nullable String projectKey) { | |||
public UsersRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@@ -76,7 +76,7 @@ public class UsersWsRequest { | |||
return query; | |||
} | |||
public UsersWsRequest setQuery(@Nullable String query) { | |||
public UsersRequest setQuery(@Nullable String query) { | |||
this.query = query; | |||
return this; | |||
} | |||
@@ -86,7 +86,7 @@ public class UsersWsRequest { | |||
return page; | |||
} | |||
public UsersWsRequest setPage(int page) { | |||
public UsersRequest setPage(int page) { | |||
this.page = page; | |||
return this; | |||
} | |||
@@ -96,7 +96,7 @@ public class UsersWsRequest { | |||
return pageSize; | |||
} | |||
public UsersWsRequest setPageSize(int pageSize) { | |||
public UsersRequest setPageSize(int pageSize) { | |||
this.pageSize = pageSize; | |||
return this; | |||
} |
@@ -27,14 +27,14 @@ import javax.annotation.concurrent.Immutable; | |||
import static com.google.common.base.Preconditions.checkArgument; | |||
@Immutable | |||
public class BulkUpdateKeyWsRequest { | |||
public class BulkUpdateKeyRequest { | |||
private final String id; | |||
private final String key; | |||
private final String from; | |||
private final String to; | |||
private final boolean dryRun; | |||
public BulkUpdateKeyWsRequest(Builder builder) { | |||
public BulkUpdateKeyRequest(Builder builder) { | |||
this.id = builder.id; | |||
this.key = builder.key; | |||
this.from = builder.from; | |||
@@ -104,10 +104,10 @@ public class BulkUpdateKeyWsRequest { | |||
return this; | |||
} | |||
public BulkUpdateKeyWsRequest build() { | |||
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 BulkUpdateKeyWsRequest(this); | |||
return new BulkUpdateKeyRequest(this); | |||
} | |||
} | |||
} |
@@ -85,7 +85,7 @@ public class ProjectsService extends BaseService { | |||
.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())) | |||
@@ -98,7 +98,7 @@ public class ProjectsService extends BaseService { | |||
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()) | |||
@@ -107,7 +107,7 @@ public class ProjectsService extends BaseService { | |||
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()) | |||
@@ -117,7 +117,7 @@ public class ProjectsService extends BaseService { | |||
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())) |
@@ -29,7 +29,7 @@ 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 { | |||
public class SearchRequest { | |||
private final String organization; | |||
private final String query; | |||
@@ -42,7 +42,7 @@ public class SearchWsRequest { | |||
private final List<String> projects; | |||
private final List<String> projectIds; | |||
public SearchWsRequest(Builder builder) { | |||
public SearchRequest(Builder builder) { | |||
this.organization = builder.organization; | |||
this.query = builder.query; | |||
this.qualifiers = builder.qualifiers; | |||
@@ -169,11 +169,11 @@ public class SearchWsRequest { | |||
return this; | |||
} | |||
public SearchWsRequest build() { | |||
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 SearchWsRequest(this); | |||
return new SearchRequest(this); | |||
} | |||
} | |||
} |
@@ -27,12 +27,12 @@ import javax.annotation.concurrent.Immutable; | |||
import static com.google.common.base.Preconditions.checkArgument; | |||
@Immutable | |||
public class UpdateKeyWsRequest { | |||
public class UpdateKeyRequest { | |||
private final String id; | |||
private final String key; | |||
private final String newKey; | |||
public UpdateKeyWsRequest(Builder builder) { | |||
public UpdateKeyRequest(Builder builder) { | |||
this.id = builder.id; | |||
this.key = builder.key; | |||
this.newKey = builder.newKey; | |||
@@ -80,9 +80,9 @@ public class UpdateKeyWsRequest { | |||
return this; | |||
} | |||
public UpdateKeyWsRequest build() { | |||
public UpdateKeyRequest build() { | |||
checkArgument(newKey != null && !newKey.isEmpty(), "The new key must not be empty"); | |||
return new UpdateKeyWsRequest(this); | |||
return new UpdateKeyRequest(this); | |||
} | |||
} | |||
} |
@@ -25,7 +25,7 @@ import org.sonarqube.ws.Common.Severity; | |||
import static java.util.Objects.requireNonNull; | |||
public class ActivateRuleWsRequest { | |||
public class ActivateRuleRequest { | |||
private final Optional<String> params; | |||
private final String key; | |||
private final Optional<Boolean> reset; | |||
@@ -33,7 +33,7 @@ public class ActivateRuleWsRequest { | |||
private final Optional<Severity> severity; | |||
private final Optional<String> organization; | |||
private ActivateRuleWsRequest(Builder builder) { | |||
private ActivateRuleRequest(Builder builder) { | |||
organization = requireNonNull(builder.organization); | |||
params = requireNonNull(builder.params); | |||
key = requireNonNull(builder.key); | |||
@@ -42,7 +42,7 @@ public class ActivateRuleWsRequest { | |||
severity = requireNonNull(builder.severity); | |||
} | |||
public static ActivateRuleWsRequest.Builder builder() { | |||
public static ActivateRuleRequest.Builder builder() { | |||
return new Builder(); | |||
} | |||
@@ -111,8 +111,8 @@ public class ActivateRuleWsRequest { | |||
return this; | |||
} | |||
public ActivateRuleWsRequest build() { | |||
return new ActivateRuleWsRequest(this); | |||
public ActivateRuleRequest build() { | |||
return new ActivateRuleRequest(this); | |||
} | |||
} | |||
} |
@@ -20,7 +20,7 @@ | |||
package org.sonarqube.ws.client.qualityprofile; | |||
public class ChangelogWsRequest { | |||
public class ChangelogRequest { | |||
private final String language; | |||
private final String organization; | |||
@@ -30,7 +30,7 @@ public class ChangelogWsRequest { | |||
private final String since; | |||
private final String to; | |||
private ChangelogWsRequest(Builder builder) { | |||
private ChangelogRequest(Builder builder) { | |||
this.language = builder.language; | |||
this.organization = builder.organization; | |||
this.p = builder.p; | |||
@@ -119,8 +119,8 @@ public class ChangelogWsRequest { | |||
return this; | |||
} | |||
public ChangelogWsRequest build() { | |||
return new ChangelogWsRequest(this); | |||
public ChangelogRequest build() { | |||
return new ChangelogRequest(this); | |||
} | |||
} | |||
} |
@@ -82,7 +82,7 @@ public class QualityProfilesService extends BaseService { | |||
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)); | |||
@@ -100,14 +100,14 @@ public class QualityProfilesService extends BaseService { | |||
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()) | |||
@@ -243,7 +243,7 @@ public class QualityProfilesService extends BaseService { | |||
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()) |
@@ -25,12 +25,12 @@ import javax.annotation.Nullable; | |||
import static java.util.Objects.requireNonNull; | |||
public class RestoreWsRequest { | |||
public class RestoreRequest { | |||
private final File backup; | |||
private final Optional<String> organization; | |||
private RestoreWsRequest(Builder builder) { | |||
private RestoreRequest(Builder builder) { | |||
backup = requireNonNull(builder.backup); | |||
organization = requireNonNull(builder.organization); | |||
} | |||
@@ -61,8 +61,8 @@ public class RestoreWsRequest { | |||
return this; | |||
} | |||
public RestoreWsRequest build() { | |||
return new RestoreWsRequest(this); | |||
public RestoreRequest build() { | |||
return new RestoreRequest(this); | |||
} | |||
} | |||
} |
@@ -22,7 +22,7 @@ package org.sonarqube.ws.client.qualityprofile; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
public class SearchWsRequest { | |||
public class SearchRequest { | |||
private String organizationKey; | |||
private boolean defaults; | |||
private String language; | |||
@@ -33,7 +33,7 @@ public class SearchWsRequest { | |||
return organizationKey; | |||
} | |||
public SearchWsRequest setOrganizationKey(String organizationKey) { | |||
public SearchRequest setOrganizationKey(String organizationKey) { | |||
this.organizationKey = organizationKey; | |||
return this; | |||
} | |||
@@ -42,7 +42,7 @@ public class SearchWsRequest { | |||
return defaults; | |||
} | |||
public SearchWsRequest setDefaults(boolean defaults) { | |||
public SearchRequest setDefaults(boolean defaults) { | |||
this.defaults = defaults; | |||
return this; | |||
} | |||
@@ -52,7 +52,7 @@ public class SearchWsRequest { | |||
return language; | |||
} | |||
public SearchWsRequest setLanguage(@Nullable String language) { | |||
public SearchRequest setLanguage(@Nullable String language) { | |||
this.language = language; | |||
return this; | |||
} | |||
@@ -62,7 +62,7 @@ public class SearchWsRequest { | |||
return qualityProfile; | |||
} | |||
public SearchWsRequest setQualityProfile(@Nullable String qualityProfile) { | |||
public SearchRequest setQualityProfile(@Nullable String qualityProfile) { | |||
this.qualityProfile = qualityProfile; | |||
return this; | |||
} | |||
@@ -72,7 +72,7 @@ public class SearchWsRequest { | |||
return projectKey; | |||
} | |||
public SearchWsRequest setProjectKey(@Nullable String projectKey) { | |||
public SearchRequest setProjectKey(@Nullable String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} |
@@ -93,7 +93,7 @@ public class ComponentsServiceTest { | |||
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")); | |||
@@ -109,9 +109,9 @@ public class ComponentsServiceTest { | |||
@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")) | |||
@@ -134,7 +134,7 @@ public class ComponentsServiceTest { | |||
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) | |||
@@ -160,7 +160,7 @@ public class ComponentsServiceTest { | |||
int page = 17; | |||
int pageSize = 39; | |||
String query = randomAlphanumeric(20); | |||
underTest.tree(new TreeWsRequest() | |||
underTest.tree(new TreeRequest() | |||
.setBaseComponentId(componentId) | |||
.setBaseComponentKey(componentKey) | |||
.setComponent(componentKey) |
@@ -24,12 +24,12 @@ import org.junit.Test; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class SearchWsRequestTest { | |||
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 SearchWsRequest underTest = new SearchWsRequest(); | |||
private SearchRequest underTest = new SearchRequest(); | |||
@Test | |||
public void getActionPlans_returns_null_when_SearchWsRequest_has_just_been_instantiated() { |
@@ -81,7 +81,7 @@ public class MeasuresServiceTest { | |||
@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) | |||
@@ -110,7 +110,7 @@ public class MeasuresServiceTest { | |||
@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) |
@@ -39,7 +39,7 @@ public class OrganizationServiceTest { | |||
@Test | |||
public void search() { | |||
underTest.search(SearchWsRequest.builder() | |||
underTest.search(SearchRequest.builder() | |||
.setOrganizations("orga1", "orga2") | |||
.setPage(2) | |||
.setPageSize(10) | |||
@@ -56,7 +56,7 @@ public class OrganizationServiceTest { | |||
@Test | |||
public void search_members() { | |||
underTest.searchMembers(new SearchMembersWsRequest() | |||
underTest.searchMembers(new SearchMembersRequest() | |||
.setOrganization("orga") | |||
.setSelected("selected") | |||
.setQuery("john") | |||
@@ -99,7 +99,7 @@ public class OrganizationServiceTest { | |||
@Test | |||
public void update_project_visibility() { | |||
underTest.updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder() | |||
underTest.updateProjectVisibility(UpdateProjectVisibilityRequest.builder() | |||
.setOrganization("O1") | |||
.setProjectVisibility("private") | |||
.build()); |
@@ -83,7 +83,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -107,7 +107,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -131,7 +131,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -153,7 +153,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -175,7 +175,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -197,7 +197,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -219,7 +219,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -248,7 +248,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -268,7 +268,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -286,7 +286,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -310,7 +310,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -334,7 +334,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -354,7 +354,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -387,7 +387,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -411,7 +411,7 @@ public class PermissionsServiceTest { | |||
@Test | |||
public void searchTemplates_does_GET_on_Ws_search_templates() { | |||
underTest.searchTemplates(new SearchTemplatesWsRequest() | |||
underTest.searchTemplates(new SearchTemplatesRequest() | |||
.setQuery(QUERY_VALUE) | |||
); | |||
@@ -425,7 +425,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -443,7 +443,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -463,7 +463,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -483,7 +483,7 @@ public class PermissionsServiceTest { | |||
@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) | |||
@@ -503,7 +503,7 @@ public class PermissionsServiceTest { | |||
@Test | |||
public void users() { | |||
underTest.users(new UsersWsRequest() | |||
underTest.users(new UsersRequest() | |||
.setOrganization("org") | |||
.setProjectKey("project") | |||
.setProjectId("ABCD") |
@@ -125,7 +125,7 @@ public class ProjectsServiceTest { | |||
@Test | |||
public void bulk_delete() { | |||
underTest.bulkDelete(SearchWsRequest.builder() | |||
underTest.bulkDelete(SearchRequest.builder() | |||
.setOrganization("default") | |||
.setQuery("project") | |||
.setQualifiers(asList("TRK", "VW")) | |||
@@ -147,7 +147,7 @@ public class ProjectsServiceTest { | |||
@Test | |||
public void search() { | |||
underTest.search(SearchWsRequest.builder() | |||
underTest.search(SearchRequest.builder() | |||
.setOrganization("default") | |||
.setQuery("project") | |||
.setQualifiers(asList("TRK", "VW")) |
@@ -27,14 +27,14 @@ import static java.util.Arrays.asList; | |||
import static java.util.Collections.emptyList; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class SearchWsRequestTest { | |||
public class SearchRequestTest { | |||
@Rule | |||
public ExpectedException expectedException = ExpectedException.none(); | |||
@Test | |||
public void create_request() throws Exception { | |||
SearchWsRequest underTest = SearchWsRequest.builder() | |||
SearchRequest underTest = SearchRequest.builder() | |||
.setOrganization("orga") | |||
.setQuery("project") | |||
.setQualifiers(asList("TRK", "VW")) | |||
@@ -54,7 +54,7 @@ public class SearchWsRequestTest { | |||
expectedException.expect(IllegalArgumentException.class); | |||
expectedException.expectMessage("Page size must not be greater than 500"); | |||
SearchWsRequest.builder() | |||
SearchRequest.builder() | |||
.setPageSize(10000) | |||
.build(); | |||
} | |||
@@ -64,7 +64,7 @@ public class SearchWsRequestTest { | |||
expectedException.expect(IllegalArgumentException.class); | |||
expectedException.expectMessage("Project key list must not be empty"); | |||
SearchWsRequest.builder() | |||
SearchRequest.builder() | |||
.setProjects(emptyList()) | |||
.build(); | |||
} | |||
@@ -74,7 +74,7 @@ public class SearchWsRequestTest { | |||
expectedException.expect(IllegalArgumentException.class); | |||
expectedException.expectMessage("Project id list must not be empty"); | |||
SearchWsRequest.builder() | |||
SearchRequest.builder() | |||
.setProjectIds(emptyList()) | |||
.build(); | |||
} |
@@ -24,12 +24,12 @@ import org.junit.Rule; | |||
import org.junit.Test; | |||
import org.junit.rules.ExpectedException; | |||
public class UpdateKeyWsRequestTest { | |||
public class UpdateKeyRequestTest { | |||
@Rule | |||
public ExpectedException expectedException = ExpectedException.none(); | |||
UpdateKeyWsRequest.Builder underTest = UpdateKeyWsRequest.builder(); | |||
UpdateKeyRequest.Builder underTest = UpdateKeyRequest.builder(); | |||
@Test | |||
public void fail_if_new_key_is_null() { |
@@ -61,7 +61,7 @@ public class QualityProfilesServiceTest { | |||
@Test | |||
public void search() { | |||
underTest.search(new SearchWsRequest() | |||
underTest.search(new SearchRequest() | |||
.setDefaults(true) | |||
.setProjectKey("project") | |||
.setLanguage("language") | |||
@@ -184,7 +184,7 @@ public class QualityProfilesServiceTest { | |||
@Test | |||
public void activate_rule() { | |||
underTest.activateRule(ActivateRuleWsRequest.builder() | |||
underTest.activateRule(ActivateRuleRequest.builder() | |||
.setRuleKey("R1") | |||
.setKey("P1") | |||
.setOrganization("O1") |
@@ -45,8 +45,8 @@ import org.sonarqube.ws.Qualityprofiles.CreateWsResponse.QualityProfile; | |||
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; | |||
@@ -226,14 +226,14 @@ public class AnalysisEsResilienceTest { | |||
} | |||
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( |
@@ -32,9 +32,9 @@ import org.sonarqube.ws.Favorites.Favorite; | |||
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; | |||
@@ -105,18 +105,18 @@ public class FavoriteTest { | |||
} | |||
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()); |
@@ -28,7 +28,7 @@ import org.junit.Before; | |||
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; | |||
@@ -134,6 +134,6 @@ public class FileExclusionsTest { | |||
} | |||
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(); | |||
} | |||
} |