aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-qa-util
diff options
context:
space:
mode:
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>2017-11-25 07:21:02 +0100
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>2017-11-29 20:24:11 +0100
commitb4a1564642ca0fc1528f2bf4b638c57860649775 (patch)
treedcf7abe674b93f6980bfb1e4c155b31539102e8d /server/sonar-qa-util
parent2f73756a57ab7ead3d913aab95f9102242ae9aac (diff)
downloadsonarqube-b4a1564642ca0fc1528f2bf4b638c57860649775.tar.gz
sonarqube-b4a1564642ca0fc1528f2bf4b638c57860649775.zip
Apply naming conventions in sonar-ws protobuf
Diffstat (limited to 'server/sonar-qa-util')
-rw-r--r--server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/OrganizationTester.java18
-rw-r--r--server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/ProjectTester.java4
-rw-r--r--server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java4
-rw-r--r--server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/UserTester.java2
4 files changed, 14 insertions, 14 deletions
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/OrganizationTester.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/OrganizationTester.java
index 08c317c6d40..f38dbde22e8 100644
--- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/OrganizationTester.java
+++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/OrganizationTester.java
@@ -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))
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/ProjectTester.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/ProjectTester.java
index 9c48acaf47b..00eaf34ca73 100644
--- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/ProjectTester.java
+++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/ProjectTester.java
@@ -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()));
}
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java
index 102581d155d..38e81ca6769 100644
--- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java
+++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java
@@ -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();
diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/UserTester.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/UserTester.java
index d5546e5761a..9445767c8f1 100644
--- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/UserTester.java
+++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/UserTester.java
@@ -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;
}