From b4a1564642ca0fc1528f2bf4b638c57860649775 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Sat, 25 Nov 2017 07:21:02 +0100 Subject: [PATCH] Apply naming conventions in sonar-ws protobuf --- .../sonarqube/qa/util/OrganizationTester.java | 18 ++--- .../org/sonarqube/qa/util/ProjectTester.java | 4 +- .../org/sonarqube/qa/util/QProfileTester.java | 4 +- .../org/sonarqube/qa/util/UserTester.java | 2 +- .../server/component/ws/SearchAction.java | 12 +-- .../sonar/server/component/ws/ShowAction.java | 14 ++-- .../sonar/server/component/ws/TreeAction.java | 28 +++---- .../sonar/server/issue/IssueQueryFactory.java | 16 ++-- .../server/issue/ws/ComponentTagsAction.java | 6 +- .../sonar/server/issue/ws/SearchAction.java | 14 ++-- .../issue/ws/SearchAdditionalField.java | 4 +- .../server/measure/ws/ComponentAction.java | 22 ++--- .../measure/ws/ComponentTreeAction.java | 30 +++---- .../measure/ws/ComponentTreeDataLoader.java | 24 +++--- .../server/measure/ws/ComponentTreeSort.java | 18 ++--- .../sonar/server/measure/ws/HasMeasure.java | 4 +- .../ws/SearchProjectPermissionsAction.java | 10 +-- .../SearchProjectPermissionsDataLoader.java | 12 +-- .../AddProjectCreatorToTemplateAction.java | 10 +-- .../ws/template/AddUserToTemplateAction.java | 8 +- .../ws/template/ApplyTemplateAction.java | 8 +- .../ws/template/BulkApplyTemplateAction.java | 10 +-- .../ws/template/CreateTemplateAction.java | 10 +-- .../ws/template/DeleteTemplateAction.java | 8 +- ...emoveProjectCreatorFromTemplateAction.java | 8 +- .../RemoveUserFromTemplateAction.java | 8 +- .../ws/template/SearchTemplatesAction.java | 4 +- .../template/SearchTemplatesDataLoader.java | 6 +- .../ws/template/SetDefaultTemplateAction.java | 10 +-- .../ws/template/UpdateTemplateAction.java | 8 +- .../server/project/ws/BulkDeleteAction.java | 8 +- .../project/ws/BulkUpdateKeyAction.java | 10 +-- .../sonar/server/project/ws/SearchAction.java | 12 +-- .../server/project/ws/UpdateKeyAction.java | 8 +- .../qualityprofile/ws/SearchAction.java | 20 ++--- .../server/component/ws/SearchActionTest.java | 22 ++--- .../server/issue/IssueQueryFactoryTest.java | 72 ++++++++--------- .../issue/ws/ComponentTagsActionTest.java | 6 +- .../measure/ws/ComponentTreeSortTest.java | 34 ++++---- .../ws/SearchMembersActionTest.java | 4 +- .../server/project/ws/SearchActionTest.java | 40 +++++----- .../client/component/ComponentsService.java | 8 +- ...earchWsRequest.java => SearchRequest.java} | 14 ++-- .../{ShowWsRequest.java => ShowRequest.java} | 8 +- ...WsRequest.java => SuggestionsRequest.java} | 8 +- .../{TreeWsRequest.java => TreeRequest.java} | 24 +++--- .../ws/client/issue/IssuesService.java | 2 +- ...earchWsRequest.java => SearchRequest.java} | 80 +++++++++---------- ...ntWsRequest.java => ComponentRequest.java} | 18 ++--- ...Request.java => ComponentTreeRequest.java} | 38 ++++----- .../ws/client/measure/MeasuresService.java | 4 +- ...reateWsRequest.java => CreateRequest.java} | 8 +- .../organization/OrganizationService.java | 10 +-- ...Request.java => SearchMembersRequest.java} | 12 +-- ...earchWsRequest.java => SearchRequest.java} | 8 +- ...va => UpdateProjectVisibilityRequest.java} | 8 +- ...pdateWsRequest.java => UpdateRequest.java} | 8 +- ...oupWsRequest.java => AddGroupRequest.java} | 14 ++-- ...st.java => AddGroupToTemplateRequest.java} | 12 +-- ...> AddProjectCreatorToTemplateRequest.java} | 8 +- ...UserWsRequest.java => AddUserRequest.java} | 12 +-- ...est.java => AddUserToTemplateRequest.java} | 12 +-- ...Request.java => ApplyTemplateRequest.java} | 12 +-- ...est.java => BulkApplyTemplateRequest.java} | 20 ++--- ...equest.java => CreateTemplateRequest.java} | 10 +-- ...equest.java => DeleteTemplateRequest.java} | 8 +- ...roupsWsRequest.java => GroupsRequest.java} | 14 ++-- .../client/permission/PermissionsService.java | 40 +++++----- ...va => RemoveGroupFromTemplateRequest.java} | 14 ++-- ...WsRequest.java => RemoveGroupRequest.java} | 14 ++-- ...oveProjectCreatorFromTemplateRequest.java} | 8 +- ...ava => RemoveUserFromTemplateRequest.java} | 12 +-- ...rWsRequest.java => RemoveUserRequest.java} | 10 +-- ...a => SearchProjectPermissionsRequest.java} | 14 ++-- ...quest.java => SearchTemplatesRequest.java} | 6 +- ...st.java => SetDefaultTemplateRequest.java} | 10 +-- ...equest.java => UpdateTemplateRequest.java} | 10 +-- ...{UsersWsRequest.java => UsersRequest.java} | 16 ++-- ...Request.java => BulkUpdateKeyRequest.java} | 8 +- .../ws/client/project/ProjectsService.java | 8 +- ...earchWsRequest.java => SearchRequest.java} | 8 +- ...eyWsRequest.java => UpdateKeyRequest.java} | 8 +- ...sRequest.java => ActivateRuleRequest.java} | 10 +-- ...ogWsRequest.java => ChangelogRequest.java} | 8 +- .../QualityProfilesService.java | 8 +- ...toreWsRequest.java => RestoreRequest.java} | 8 +- ...earchWsRequest.java => SearchRequest.java} | 12 +-- .../component/ComponentsServiceTest.java | 10 +-- ...equestTest.java => SearchRequestTest.java} | 4 +- .../client/measure/MeasuresServiceTest.java | 4 +- .../organization/OrganizationServiceTest.java | 6 +- .../permission/PermissionsServiceTest.java | 40 +++++----- .../client/project/ProjectsServiceTest.java | 4 +- ...equestTest.java => SearchRequestTest.java} | 10 +-- ...estTest.java => UpdateKeyRequestTest.java} | 4 +- .../QualityProfilesServiceTest.java | 4 +- .../analysis/AnalysisEsResilienceTest.java | 8 +- .../tests/analysis/FavoriteTest.java | 14 ++-- .../tests/analysis/FileExclusionsTest.java | 4 +- .../tests/analysis/PermissionTest.java | 4 +- .../sonarqube/tests/analysis/ScannerTest.java | 4 +- .../ExecuteAnalysisPermissionTest.java | 14 ++-- .../authorization/IssuePermissionTest.java | 4 +- .../authorization/PermissionSearchTest.java | 50 ++++++------ .../PermissionTemplatePageTest.java | 12 +-- .../authorization/PermissionTemplateTest.java | 24 +++--- .../ProvisioningPermissionTest.java | 16 ++-- .../QualityProfileAdminPermissionTest.java | 4 +- .../ce/ReportFailureNotificationTest.java | 6 +- .../tests/component/ComponentsWsTest.java | 8 +- .../CrossProjectDuplicationsTest.java | 4 +- .../tests/duplication/DuplicationsTest.java | 4 +- .../tests/issue/CommonRulesTest.java | 4 +- .../tests/issue/IssueActionTest.java | 12 +-- .../tests/issue/IssueBulkChangeTest.java | 4 +- .../issue/IssueFilterOnCommonRulesTest.java | 6 +- .../tests/issue/IssueNotificationsTest.java | 10 +-- .../tests/issue/IssueSearchTest.java | 12 +-- .../sonarqube/tests/issue/IssueTagsTest.java | 8 +- .../tests/issue/IssueTrackingTest.java | 20 ++--- .../tests/issue/IssueWorkflowTest.java | 8 +- .../issue/OrganizationIssueAssignTest.java | 8 +- .../org/sonarqube/tests/lite/LiteTest.java | 18 ++--- .../tests/measure/MeasuresWsTest.java | 10 +-- .../tests/organization/BillingTest.java | 6 +- .../OrganizationMembershipTest.java | 6 +- .../tests/organization/OrganizationTest.java | 38 ++++----- .../PersonalOrganizationTest.java | 4 +- .../performance/scanner/DuplicationTest.java | 4 +- .../project/ProjectBulkDeletionTest.java | 8 +- .../tests/project/ProjectDeletionTest.java | 6 +- .../tests/project/ProjectKeyUpdateTest.java | 22 ++--- .../project/ProjectProvisioningTest.java | 4 +- .../tests/project/ProjectSearchTest.java | 8 +- .../project/ProjectVisibilityPageTest.java | 4 +- .../OrganizationQualityGateUiTest.java | 3 +- .../tests/qualityGate/QualityGateTest.java | 4 +- .../TechnicalDebtInIssueChangelogTest.java | 4 +- .../tests/qualityModel/TechnicalDebtTest.java | 4 +- ...uiltInQualityProfilesNotificationTest.java | 12 +-- .../BuiltInQualityProfilesTest.java | 8 +- .../CustomQualityProfilesTest.java | 8 +- .../QualityProfilesEditTest.java | 15 ++-- .../qualityProfile/QualityProfilesWsTest.java | 12 +-- .../org/sonarqube/tests/rule/RulesWsTest.java | 2 +- .../tests/serverSystem/LogsTest.java | 4 +- .../tests/serverSystem/RestartTest.java | 4 +- .../tests/settings/SettingsTest.java | 12 +-- .../sonarqube/tests/upgrade/UpgradeTest.java | 4 +- .../user/OAuth2IdentityProviderTest.java | 4 +- tests/src/test/java/util/ItUtils.java | 16 ++-- tests/src/test/java/util/issue/IssueRule.java | 10 +-- tests/src/test/java/util/user/UserRule.java | 7 +- 153 files changed, 908 insertions(+), 909 deletions(-) rename sonar-ws/src/main/java/org/sonarqube/ws/client/component/{SearchWsRequest.java => SearchRequest.java} (83%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/component/{ShowWsRequest.java => ShowRequest.java} (87%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/component/{SuggestionsWsRequest.java => SuggestionsRequest.java} (92%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/component/{TreeWsRequest.java => TreeRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/issue/{SearchWsRequest.java => SearchRequest.java} (72%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/measure/{ComponentWsRequest.java => ComponentRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/measure/{ComponentTreeWsRequest.java => ComponentTreeRequest.java} (75%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/organization/{CreateWsRequest.java => CreateRequest.java} (93%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/organization/{SearchMembersWsRequest.java => SearchMembersRequest.java} (81%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/organization/{SearchWsRequest.java => SearchRequest.java} (93%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/organization/{UpdateProjectVisibilityWsRequest.java => UpdateProjectVisibilityRequest.java} (89%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/organization/{UpdateWsRequest.java => UpdateRequest.java} (94%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{AddGroupWsRequest.java => AddGroupRequest.java} (81%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{AddGroupToTemplateWsRequest.java => AddGroupToTemplateRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{AddProjectCreatorToTemplateWsRequest.java => AddProjectCreatorToTemplateRequest.java} (91%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{AddUserWsRequest.java => AddUserRequest.java} (84%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{AddUserToTemplateWsRequest.java => AddUserToTemplateRequest.java} (81%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{ApplyTemplateWsRequest.java => ApplyTemplateRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{BulkApplyTemplateWsRequest.java => BulkApplyTemplateRequest.java} (77%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{CreateTemplateWsRequest.java => CreateTemplateRequest.java} (83%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{DeleteTemplateWsRequest.java => DeleteTemplateRequest.java} (84%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{GroupsWsRequest.java => GroupsRequest.java} (83%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{RemoveGroupFromTemplateWsRequest.java => RemoveGroupFromTemplateRequest.java} (78%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{RemoveGroupWsRequest.java => RemoveGroupRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{RemoveProjectCreatorFromTemplateWsRequest.java => RemoveProjectCreatorFromTemplateRequest.java} (90%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{RemoveUserFromTemplateWsRequest.java => RemoveUserFromTemplateRequest.java} (80%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{RemoveUserWsRequest.java => RemoveUserRequest.java} (84%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{SearchProjectPermissionsWsRequest.java => SearchProjectPermissionsRequest.java} (78%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{SearchTemplatesWsRequest.java => SearchTemplatesRequest.java} (87%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{SetDefaultTemplateWsRequest.java => SetDefaultTemplateRequest.java} (81%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{UpdateTemplateWsRequest.java => UpdateTemplateRequest.java} (83%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/permission/{UsersWsRequest.java => UsersRequest.java} (81%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/project/{BulkUpdateKeyWsRequest.java => BulkUpdateKeyRequest.java} (93%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/project/{SearchWsRequest.java => SearchRequest.java} (97%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/project/{UpdateKeyWsRequest.java => UpdateKeyRequest.java} (92%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/{ActivateRuleWsRequest.java => ActivateRuleRequest.java} (92%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/{ChangelogWsRequest.java => ChangelogRequest.java} (94%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/{RestoreWsRequest.java => RestoreRequest.java} (91%) rename sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/{SearchWsRequest.java => SearchRequest.java} (82%) rename sonar-ws/src/test/java/org/sonarqube/ws/client/issue/{SearchWsRequestTest.java => SearchRequestTest.java} (99%) rename sonar-ws/src/test/java/org/sonarqube/ws/client/project/{SearchWsRequestTest.java => SearchRequestTest.java} (93%) rename sonar-ws/src/test/java/org/sonarqube/ws/client/project/{UpdateKeyWsRequestTest.java => UpdateKeyRequestTest.java} (93%) 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... populators) { + public final Organizations.Organization generate(Consumer... 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 users = service().searchMembers(new SearchMembersWsRequest() + List 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... 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; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java index 8e847517bc8..2307faf3e85 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java @@ -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()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowAction.java index 8288af7cec1..3799794e012 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowAction.java @@ -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 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)); diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java index 1bd0014c0b0..e2c31ae4325 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java @@ -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 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 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 childrenQualifiers = childrenQualifiers(request, baseComponent.qualifier()); ComponentTreeQuery.Builder query = ComponentTreeQuery.builder() @@ -263,7 +263,7 @@ public class TreeAction implements ComponentsWsAction { } @CheckForNull - private List childrenQualifiers(TreeWsRequest request, String baseQualifier) { + private List childrenQualifiers(TreeRequest request, String baseQualifier) { List requestQualifiers = request.getQualifiers(); List 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 paginateComponents(List components, TreeWsRequest wsRequest) { + private static List paginateComponents(List components, TreeRequest wsRequest) { return components.stream().skip(offset(wsRequest.getPage(), wsRequest.getPageSize())) .limit(wsRequest.getPageSize()).collect(toList()); } - public static List sortComponents(List components, TreeWsRequest wsRequest) { + public static List sortComponents(List components, TreeRequest wsRequest) { List sortParameters = wsRequest.getSort(); if (sortParameters == null || sortParameters.isEmpty()) { return components; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java index 63974471ac0..a4a2f341f48 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java @@ -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 componentUuids) { + private Date buildCreatedAfterFromRequest(DbSession dbSession, SearchRequest request, List 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 allComponents) { + private boolean mergeDeprecatedComponentParameters(DbSession session, SearchRequest request, List allComponents) { Boolean onComponentOnly = request.getOnComponentOnly(); Collection components = request.getComponents(); Collection componentUuids = request.getComponentUuids(); @@ -232,7 +232,7 @@ public class IssueQueryFactory { } private void addComponentParameters(IssueQuery.Builder builder, DbSession session, boolean onComponentOnly, - List components, SearchWsRequest request) { + List 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 components, SearchWsRequest request) { + private void addComponentsBasedOnQualifier(IssueQuery.Builder builder, DbSession dbSession, List 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 applications, SearchWsRequest request) { + private void addApplications(IssueQuery.Builder builder, DbSession dbSession, List applications, SearchRequest request) { Set 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 applicationUuids) { + private void addCreatedAfterByProjects(IssueQuery.Builder builder, DbSession dbSession, SearchRequest request, Set applicationUuids) { if (request.getSinceLeakPeriod() == null || !request.getSinceLeakPeriod()) { return; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/ComponentTagsAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/ComponentTagsAction.java index a28c041a372..5bb5d38c8f1 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/ComponentTagsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/ComponentTagsAction.java @@ -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(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java index 5293f0491c9..b8b744d83eb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -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 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)) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java index f6c870335e4..0c8ef7e9224 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java @@ -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 getFromRequest(SearchWsRequest request) { + public static EnumSet getFromRequest(SearchRequest request) { List labels = request.getAdditionalFields(); if (labels == null) { return EnumSet.noneOf(SearchAdditionalField.class); diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java index 03a8edd8eb7..fd5d78e90ef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java @@ -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 refComponent, List measures, - List metrics, List periods) { + private static ComponentWsResponse buildResponse(ComponentRequest request, ComponentDto component, Optional refComponent, List measures, + List metrics, List periods) { ComponentWsResponse.Builder response = ComponentWsResponse.newBuilder(); Map metricsById = Maps.uniqueIndex(metrics, MetricDto::getId); Map measuresByMetric = new HashMap<>(); @@ -210,7 +210,7 @@ public class ComponentAction implements MeasuresWsAction { return response.build(); } - private List searchMetrics(DbSession dbSession, ComponentWsRequest request) { + private List searchMetrics(DbSession dbSession, ComponentRequest request) { List metrics = dbClient.metricDao().selectByKeys(dbSession, request.getMetricKeys()); if (metrics.size() < request.getMetricKeys().size()) { List 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) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java index 2423e61ee2f..b9f79a6beef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java @@ -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 additionalFields = request.getAdditionalFields(); return additionalFields != null && additionalFields.contains(ADDITIONAL_METRICS); } - private static boolean arePeriodsInResponse(ComponentTreeWsRequest request) { + private static boolean arePeriodsInResponse(ComponentTreeRequest request) { List 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 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 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 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 measures, diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java index e599bb77803..fc2dba8ae1f 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java @@ -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 searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) { + private List searchMetrics(DbSession dbSession, ComponentTreeRequest request) { List metricKeys = requireNonNull(request.getMetricKeys()); List metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys); if (metrics.size() < metricKeys.size()) { @@ -246,7 +246,7 @@ public class ComponentTreeDataLoader { } private static List filterComponents(List components, - Table measuresByComponentUuidAndMetric, List metrics, ComponentTreeWsRequest wsRequest) { + Table measuresByComponentUuidAndMetric, List 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 sortComponents(List components, ComponentTreeWsRequest wsRequest, List metrics, - Table measuresByComponentUuidAndMetric) { + private static List sortComponents(List components, ComponentTreeRequest wsRequest, List metrics, + Table measuresByComponentUuidAndMetric) { return ComponentTreeSort.sortComponents(components, wsRequest, metrics, measuresByComponentUuidAndMetric); } - private static List paginateComponents(List components, ComponentTreeWsRequest wsRequest) { + private static List paginateComponents(List 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 childrenQualifiers(ComponentTreeWsRequest request, String baseQualifier) { + private List childrenQualifiers(ComponentTreeRequest request, String baseQualifier) { List requestQualifiers = request.getQualifiers(); List 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 childrenQualifiers = childrenQualifiers(wsRequest, baseComponent.qualifier()); ComponentTreeQuery.Builder componentTreeQueryBuilder = ComponentTreeQuery.builder() diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java index af94995abd0..cf881dd6126 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java @@ -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 sortComponents(List components, ComponentTreeWsRequest wsRequest, List metrics, - Table measuresByComponentUuidAndMetric) { + public static List sortComponents(List components, ComponentTreeRequest wsRequest, List metrics, + Table measuresByComponentUuidAndMetric) { List 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 metricValueOrdering(ComponentTreeWsRequest wsRequest, List metrics, - Table measuresByComponentUuidAndMetric) { + private static Ordering metricValueOrdering(ComponentTreeRequest wsRequest, List metrics, + Table 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 metricPeriodOrdering(ComponentTreeWsRequest wsRequest, List metrics, - Table measuresByComponentUuidAndMetric) { + private static Ordering metricPeriodOrdering(ComponentTreeRequest wsRequest, List metrics, + Table 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 numericalMetricPeriodOrdering(ComponentTreeWsRequest request, @Nullable MetricDto metric, - Table measuresByComponentUuidAndMetric) { + private static Ordering numericalMetricPeriodOrdering(ComponentTreeRequest request, @Nullable MetricDto metric, + Table measuresByComponentUuidAndMetric) { Ordering ordering = Ordering.natural(); if (!request.getAsc()) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/HasMeasure.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/HasMeasure.java index 6893c6851bd..3f0b7ed5bdb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/HasMeasure.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/HasMeasure.java @@ -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 { private final Predicate predicate; - HasMeasure(Table table, MetricDto metric, ComponentTreeWsRequest request) { + HasMeasure(Table table, MetricDto metric, ComponentTreeRequest request) { Integer periodIndex = request.getMetricPeriodSort(); this.predicate = periodIndex == null ? new HasAbsoluteValue(table, metric) diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsAction.java index 1782ae1ef81..2eb7531c944 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsAction.java @@ -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 projectRef = newOptionalWsProjectRef(request.getProjectId(), request.getProjectKey()); if (projectRef.isPresent()) { ComponentDto project = wsSupport.getRootComponentOrModule(dbSession, projectRef.get()); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsDataLoader.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsDataLoader.java index ef9dabdcb7e..973144fcd19 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsDataLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchProjectPermissionsDataLoader.java @@ -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 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 searchRootComponents(DbSession dbSession, SearchProjectPermissionsWsRequest request, Paging paging) { + private List searchRootComponents(DbSession dbSession, SearchProjectPermissionsRequest request, Paging paging) { Optional 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()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddProjectCreatorToTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddProjectCreatorToTemplateAction.java index f694f5ec6c4..0d4956088e2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddProjectCreatorToTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddProjectCreatorToTemplateAction.java @@ -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()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddUserToTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddUserToTemplateAction.java index 75f2b02f408..5c38b5a5ab7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddUserToTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddUserToTemplateAction.java @@ -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(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java index 7847af840fd..655d3a866f5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java @@ -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())); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java index b5cdd5f896e..e2f82dfc576 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java @@ -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 qualifiers = request.getQualifiers(); ComponentQuery.Builder query = ComponentQuery.builder() .setQualifiers(qualifiers.toArray(new String[qualifiers.size()])); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/CreateTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/CreateTemplateAction.java index 91ba4eaf243..216cec4e230 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/CreateTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/CreateTemplateAction.java @@ -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()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java index 0ae76ba8f69..821364c7fe0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java @@ -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())); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveProjectCreatorFromTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveProjectCreatorFromTemplateAction.java index 813efee8b10..2ff3728cb0b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveProjectCreatorFromTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveProjectCreatorFromTemplateAction.java @@ -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())); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateAction.java index 6ce9f1f5e76..f91d243ae2c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateAction.java @@ -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(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java index 87266ae544e..29e68967dd0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java @@ -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()); diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesDataLoader.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesDataLoader.java index 20cc847c804..c95aa7f3132 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesDataLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesDataLoader.java @@ -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 templates = searchTemplates(dbSession, request); List templateIds = Lists.transform(templates, PermissionTemplateDto::getId); @@ -63,7 +63,7 @@ public class SearchTemplatesDataLoader { return data.build(); } - private List searchTemplates(DbSession dbSession, SearchTemplatesWsRequest request) { + private List searchTemplates(DbSession dbSession, SearchTemplatesRequest request) { return dbClient.permissionTemplateDao().selectAll(dbSession, request.getOrganizationUuid(), request.getQuery()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java index 49eca0a59ff..ea9ed0b4e71 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java @@ -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())); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/UpdateTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/UpdateTemplateAction.java index b2a38561c75..94f59901b1e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/UpdateTemplateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/UpdateTemplateAction.java @@ -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(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java b/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java index ec129767b14..a220e876149 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java @@ -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)) diff --git a/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkUpdateKeyAction.java b/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkUpdateKeyAction.java index 9eefaa3f91b..d2a8cc844eb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkUpdateKeyAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/project/ws/BulkUpdateKeyAction.java @@ -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)) diff --git a/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java index f9f1dab3ee1..9ef198b33b2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java @@ -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 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()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/project/ws/UpdateKeyAction.java b/server/sonar-server/src/main/java/org/sonar/server/project/ws/UpdateKeyAction.java index 4f14b4793e8..49e79a01085 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/project/ws/UpdateKeyAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/project/ws/UpdateKeyAction.java @@ -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)) diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java index 3e90a178b13..892096abe07 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java @@ -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 searchProfiles(DbSession dbSession, SearchWsRequest request, OrganizationDto organization, List defaultProfiles, + private List searchProfiles(DbSession dbSession, SearchRequest request, OrganizationDto organization, List defaultProfiles, @Nullable ComponentDto project) { Collection profiles = selectAllProfiles(dbSession, organization); @@ -223,15 +223,15 @@ public class SearchAction implements QProfileWsAction { return p -> languages.get(p.getLanguage()) != null; } - private static Predicate byName(SearchWsRequest request) { + private static Predicate byName(SearchRequest request) { return p -> request.getQualityProfile() == null || Objects.equals(p.getName(), request.getQualityProfile()); } - private static Predicate byLanguage(SearchWsRequest request) { + private static Predicate byLanguage(SearchRequest request) { return p -> request.getLanguage() == null || Objects.equals(p.getLanguage(), request.getLanguage()); } - private static Predicate byDefault(SearchWsRequest request, List defaultProfiles) { + private static Predicate byDefault(SearchRequest request, List defaultProfiles) { Set defaultProfileUuids = defaultProfiles.stream().map(QProfileDto::getKee).collect(Collectors.toSet()); return p -> !request.getDefaults() || defaultProfileUuids.contains(p.getKee()); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchActionTest.java index 98357f4b30c..2a94d9e999d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchActionTest.java @@ -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)); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryFactoryTest.java index e1f4cd234c3..9ac942c58b5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryFactoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryFactoryTest.java @@ -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); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java index b157ea73f71..b020c4426fc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java @@ -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 captor = ArgumentCaptor.forClass(SearchWsRequest.class); + ArgumentCaptor 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 captor = ArgumentCaptor.forClass(SearchWsRequest.class); + ArgumentCaptor captor = ArgumentCaptor.forClass(SearchRequest.class); when(issueQueryFactory.create(captor.capture())).thenReturn(mock(IssueQuery.class)); when(service.countTags(any(IssueQuery.class), eq(5))).thenReturn(tags); diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeSortTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeSortTest.java index a829d11a989..379f7747237 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeSortTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeSortTest.java @@ -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 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 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 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 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 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 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 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 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 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 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 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 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 result = sortComponents(wsRequest); @@ -249,7 +249,7 @@ public class ComponentTreeSortTest { .containsExactly("path-1", "path-2", "path-3"); } - private List sortComponents(ComponentTreeWsRequest wsRequest) { + private List sortComponents(ComponentTreeRequest wsRequest) { return ComponentTreeSort.sortComponents(components, wsRequest, metrics, measuresByComponentUuidAndMetric); } @@ -261,8 +261,8 @@ public class ComponentTreeSortTest { .setPath(path); } - private static ComponentTreeWsRequest newRequest(List sortFields, boolean isAscending, @Nullable String metricKey) { - return new ComponentTreeWsRequest() + private static ComponentTreeRequest newRequest(List sortFields, boolean isAscending, @Nullable String metricKey) { + return new ComponentTreeRequest() .setAsc(isAscending) .setSort(sortFields) .setMetricSort(metricKey); diff --git a/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchMembersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchMembersActionTest.java index 4b9608912d7..695869c6d48 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchMembersActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/organization/ws/SearchMembersActionTest.java @@ -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() { diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java index b4f670a9bfa..0c74c2cca21 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java @@ -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 qualifiers = wsRequest.getQualifiers(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java index 6d45e829bf2..163b1fdb3e7 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java @@ -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(","))) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchRequest.java similarity index 83% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchRequest.java index 7d7dcc05323..efe91f239d8 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SearchRequest.java @@ -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 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 qualifiers) { + public SearchRequest setQualifiers(List 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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowRequest.java similarity index 87% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowRequest.java index 1ada1585b8d..2377e7dfea3 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ShowRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsRequest.java similarity index 92% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsRequest.java index ca7fd84d11c..1f28b21db1b 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/SuggestionsRequest.java @@ -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 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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeRequest.java index d941300974c..569e44ad686 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeRequest.java @@ -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 qualifiers) { + public TreeRequest setQualifiers(@Nullable List 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 sort) { + public TreeRequest setSort(@Nullable List 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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java index fb9c73feae7..58e94c13e2e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java @@ -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())) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchRequest.java similarity index 72% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchRequest.java index 427ea7f5845..841e00791da 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchRequest.java @@ -23,7 +23,7 @@ import java.util.List; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -public class SearchWsRequest { +public class SearchRequest { private List actionPlans; private List additionalFields; private Boolean asc; @@ -69,7 +69,7 @@ public class SearchWsRequest { return actionPlans; } - public SearchWsRequest setActionPlans(@Nullable List actionPlans) { + public SearchRequest setActionPlans(@Nullable List actionPlans) { this.actionPlans = actionPlans; return this; } @@ -79,7 +79,7 @@ public class SearchWsRequest { return additionalFields; } - public SearchWsRequest setAdditionalFields(@Nullable List additionalFields) { + public SearchRequest setAdditionalFields(@Nullable List 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 assignees) { + public SearchRequest setAssignees(@Nullable List assignees) { this.assignees = assignees; return this; } @@ -119,7 +119,7 @@ public class SearchWsRequest { return authors; } - public SearchWsRequest setAuthors(@Nullable List authors) { + public SearchRequest setAuthors(@Nullable List authors) { this.authors = authors; return this; } @@ -129,7 +129,7 @@ public class SearchWsRequest { return componentKeys; } - public SearchWsRequest setComponentKeys(@Nullable List componentKeys) { + public SearchRequest setComponentKeys(@Nullable List componentKeys) { this.componentKeys = componentKeys; return this; } @@ -139,7 +139,7 @@ public class SearchWsRequest { return componentUuids; } - public SearchWsRequest setComponentUuids(@Nullable List componentUuids) { + public SearchRequest setComponentUuids(@Nullable List 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 directories) { + public SearchRequest setDirectories(@Nullable List 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 facets) { + public SearchRequest setFacets(@Nullable List facets) { this.facets = facets; return this; } @@ -219,7 +219,7 @@ public class SearchWsRequest { return fileUuids; } - public SearchWsRequest setFileUuids(@Nullable List fileUuids) { + public SearchRequest setFileUuids(@Nullable List fileUuids) { this.fileUuids = fileUuids; return this; } @@ -229,7 +229,7 @@ public class SearchWsRequest { return issues; } - public SearchWsRequest setIssues(@Nullable List issues) { + public SearchRequest setIssues(@Nullable List issues) { this.issues = issues; return this; } @@ -239,7 +239,7 @@ public class SearchWsRequest { return languages; } - public SearchWsRequest setLanguages(@Nullable List languages) { + public SearchRequest setLanguages(@Nullable List languages) { this.languages = languages; return this; } @@ -249,7 +249,7 @@ public class SearchWsRequest { return moduleUuids; } - public SearchWsRequest setModuleUuids(@Nullable List moduleUuids) { + public SearchRequest setModuleUuids(@Nullable List 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 projectKeys) { + public SearchRequest setProjectKeys(@Nullable List projectKeys) { this.projectKeys = projectKeys; return this; } @@ -309,7 +309,7 @@ public class SearchWsRequest { return projectUuids; } - public SearchWsRequest setProjectUuids(@Nullable List projectUuids) { + public SearchRequest setProjectUuids(@Nullable List projectUuids) { this.projectUuids = projectUuids; return this; } @@ -319,7 +319,7 @@ public class SearchWsRequest { return resolutions; } - public SearchWsRequest setResolutions(@Nullable List resolutions) { + public SearchRequest setResolutions(@Nullable List 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 rules) { + public SearchRequest setRules(@Nullable List 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 severities) { + public SearchRequest setSeverities(@Nullable List severities) { this.severities = severities; return this; } @@ -379,7 +379,7 @@ public class SearchWsRequest { return statuses; } - public SearchWsRequest setStatuses(@Nullable List statuses) { + public SearchRequest setStatuses(@Nullable List statuses) { this.statuses = statuses; return this; } @@ -389,7 +389,7 @@ public class SearchWsRequest { return tags; } - public SearchWsRequest setTags(@Nullable List tags) { + public SearchRequest setTags(@Nullable List tags) { this.tags = tags; return this; } @@ -399,7 +399,7 @@ public class SearchWsRequest { return types; } - public SearchWsRequest setTypes(@Nullable List types) { + public SearchRequest setTypes(@Nullable List types) { this.types = types; return this; } @@ -409,7 +409,7 @@ public class SearchWsRequest { return componentRootUuids; } - public SearchWsRequest setComponentRootUuids(List componentRootUuids) { + public SearchRequest setComponentRootUuids(List componentRootUuids) { this.componentRootUuids = componentRootUuids; return this; } @@ -419,7 +419,7 @@ public class SearchWsRequest { return componentRoots; } - public SearchWsRequest setComponentRoots(@Nullable List componentRoots) { + public SearchRequest setComponentRoots(@Nullable List componentRoots) { this.componentRoots = componentRoots; return this; } @@ -429,7 +429,7 @@ public class SearchWsRequest { return components; } - public SearchWsRequest setComponents(@Nullable List components) { + public SearchRequest setComponents(@Nullable List components) { this.components = components; return this; } @@ -439,7 +439,7 @@ public class SearchWsRequest { return projects; } - public SearchWsRequest setProjects(@Nullable List projects) { + public SearchRequest setProjects(@Nullable List 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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentRequest.java index cc6e10ef7d9..4eb5bbcab20 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentRequest.java @@ -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 metricKeys) { + public ComponentRequest setMetricKeys(@Nullable List metricKeys) { this.metricKeys = metricKeys; return this; } @@ -103,7 +103,7 @@ public class ComponentWsRequest { return additionalFields; } - public ComponentWsRequest setAdditionalFields(@Nullable List additionalFields) { + public ComponentRequest setAdditionalFields(@Nullable List 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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeRequest.java similarity index 75% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeRequest.java index 0a89515828a..fa6bb474a70 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeRequest.java @@ -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 qualifiers) { + public ComponentTreeRequest setQualifiers(@Nullable List qualifiers) { this.qualifiers = qualifiers; return this; } @@ -125,7 +125,7 @@ public class ComponentTreeWsRequest { return additionalFields; } - public ComponentTreeWsRequest setAdditionalFields(@Nullable List additionalFields) { + public ComponentTreeRequest setAdditionalFields(@Nullable List 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 sort) { + public ComponentTreeRequest setSort(@Nullable List 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 metricKeys) { + public ComponentTreeRequest setMetricKeys(List 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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java index 0b0afb29cb0..201a0c9b0d5 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java @@ -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()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateRequest.java similarity index 93% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateRequest.java index e8b2073dddc..000426a2833 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/CreateRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java index 7ef6337f055..96bac737a3a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java @@ -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()); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersRequest.java similarity index 81% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersRequest.java index 06e8376117c..341a930d887 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchMembersRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchRequest.java similarity index 93% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchRequest.java index 92dbfb5d88e..b3363ab8016 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchRequest.java @@ -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 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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityRequest.java similarity index 89% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityRequest.java index e7af9537548..e6e320a66f4 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateProjectVisibilityRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateRequest.java similarity index 94% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateRequest.java index e7b15a97f0f..eb2de7b7e6d 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/UpdateRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupRequest.java similarity index 81% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupRequest.java index 99233d65875..4a70ebc5ebb 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateRequest.java index fde92b46dfe..a28c8ce7131 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateRequest.java similarity index 91% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateRequest.java index 1a438241b80..a17c90cfc80 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddProjectCreatorToTemplateRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserRequest.java similarity index 84% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserRequest.java index 0908e394bdd..fa3c9beef44 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateRequest.java similarity index 81% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateRequest.java index 21a79238539..5b4c686471d 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddUserToTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateRequest.java index edab49561fb..525e1a53b77 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/ApplyTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateRequest.java similarity index 77% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateRequest.java index bb17eb37572..6b78de83cd1 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/BulkApplyTemplateRequest.java @@ -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 qualifiers) { + public BulkApplyTemplateRequest setQualifiers(Collection 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 projects) { + public BulkApplyTemplateRequest setProjects(@Nullable Collection projects) { this.projects = projects; return this; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateRequest.java similarity index 83% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateRequest.java index 65f9d3a6eb4..6b1768a1a3a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateRequest.java similarity index 84% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateRequest.java index 50b975b7487..69582aec5bc 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/DeleteTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsRequest.java similarity index 83% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsRequest.java index 9ec6431fcea..641729bae9d 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java index c0488373597..e6e353bff5b 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java @@ -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()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateRequest.java similarity index 78% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateRequest.java index 91e4815106c..b64c3d6f1ab 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupRequest.java index 0a7930a6ef0..290d3288305 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateRequest.java similarity index 90% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateRequest.java index f5ee935b80a..49101053a82 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveProjectCreatorFromTemplateRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateRequest.java similarity index 80% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateRequest.java index 42a5fb89d2e..4db6cc28eed 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserFromTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserRequest.java similarity index 84% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserRequest.java index 2cd59a806b1..8e92b49fd78 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveUserRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsRequest.java similarity index 78% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsRequest.java index e1f0d0c1f5e..770dcbfe886 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchProjectPermissionsRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesRequest.java similarity index 87% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesRequest.java index 05587a043ed..33cf11ba2ad 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SearchTemplatesRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateRequest.java similarity index 81% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateRequest.java index 7f4a052f8d9..14f6aae40c5 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/SetDefaultTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateRequest.java similarity index 83% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateRequest.java index a378464097d..931af149676 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UpdateTemplateRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersRequest.java similarity index 81% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersRequest.java index 930178e1293..08e4168b722 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersRequest.java @@ -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; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyRequest.java similarity index 93% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyRequest.java index 41a72f3e6c9..980f6361f87 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/BulkUpdateKeyRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java index 9a42c155add..e169f4f96e1 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java @@ -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())) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchRequest.java similarity index 97% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchRequest.java index 90544b37fc2..5cf2b559dc9 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/SearchRequest.java @@ -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 projects; private final List 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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyRequest.java similarity index 92% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyRequest.java index 206cb827cc2..0995a388c24 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/UpdateKeyRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java similarity index 92% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java index e98b2b396e2..70499d87f41 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java @@ -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 params; private final String key; private final Optional reset; @@ -33,7 +33,7 @@ public class ActivateRuleWsRequest { private final Optional severity; private final Optional 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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java similarity index 94% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java index d47024682a9..5c74416c9bc 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java @@ -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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java index 30d6141fa5d..45451c61de2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java @@ -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()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java similarity index 91% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java index 908115d6822..c4cbdaec421 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java @@ -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 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); } } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java similarity index 82% rename from sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchWsRequest.java rename to sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java index 7cf4b966993..1df9c059e6a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java @@ -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; } diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java index 5e6f3fa211a..86f01cbc370 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java @@ -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) diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchRequestTest.java similarity index 99% rename from sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java rename to sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchRequestTest.java index 2d05fda7b92..b4228376693 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchRequestTest.java @@ -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 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() { diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java index 653d79aba19..cfdc00f510c 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java @@ -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) diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java index aefc8a6411a..f15381affaa 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/organization/OrganizationServiceTest.java @@ -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()); diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java index 0d51269ce80..9287748363f 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java @@ -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") diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java index 657b7f0e478..9b8fbb04478 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java @@ -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")) diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchWsRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchRequestTest.java similarity index 93% rename from sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchWsRequestTest.java rename to sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchRequestTest.java index bf0f455215d..ee64ad762ca 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchWsRequestTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/SearchRequestTest.java @@ -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(); } diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyWsRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyRequestTest.java similarity index 93% rename from sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyWsRequestTest.java rename to sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyRequestTest.java index 0eb51978769..7b99e955c7b 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyWsRequestTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/UpdateKeyRequestTest.java @@ -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() { diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java index 015186a588e..2718136410c 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java @@ -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") diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java index c0615144afd..a02bb02e8be 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java @@ -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 searchFile(String key, Organization organization) { - SuggestionsWsRequest query = SuggestionsWsRequest.builder() + SuggestionsRequest query = SuggestionsRequest.builder() .setS(key) .build(); Map response = ItUtils.jsonToMap( diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/FavoriteTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/FavoriteTest.java index 14b60781d47..6d291bca43d 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/FavoriteTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/FavoriteTest.java @@ -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()); diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/FileExclusionsTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/FileExclusionsTest.java index 980cd9cafae..17c6a7357bb 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/FileExclusionsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/FileExclusionsTest.java @@ -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 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(); } } diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/PermissionTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/PermissionTest.java index b7d8921246d..d595e032cad 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/PermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/PermissionTest.java @@ -31,7 +31,7 @@ import org.junit.Rule; import org.junit.Test; import org.sonarqube.ws.UserTokens; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.usertokens.GenerateRequest; import org.sonarqube.ws.client.usertokens.RevokeRequest; import org.sonarqube.ws.client.usertokens.UserTokensService; @@ -147,7 +147,7 @@ public class PermissionTest { } private void addUserPermission(String login, String permission, @Nullable String projectKey) { - adminWsClient.permissions().addUser(new AddUserWsRequest() + adminWsClient.permissions().addUser(new AddUserRequest() .setLogin(login) .setPermission(permission) .setProjectKey(projectKey)); diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/ScannerTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/ScannerTest.java index 53e0dc50abb..bdc330eec29 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/ScannerTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/ScannerTest.java @@ -33,7 +33,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.sonarqube.qa.util.Tester; import org.sonarqube.tests.Category3Suite; -import org.sonarqube.ws.client.component.SearchWsRequest; +import org.sonarqube.ws.client.component.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -68,7 +68,7 @@ public class ScannerTest { scan("shared/xoo-multi-modules-sample"); scan("shared/xoo-multi-modules-sample", "sonar.branch", "branch/0.x"); - assertThat(tester.wsClient().components().search(new SearchWsRequest().setQualifiers(singletonList("TRK"))).getComponentsList()).hasSize(2); + assertThat(tester.wsClient().components().search(new SearchRequest().setQualifiers(singletonList("TRK"))).getComponentsList()).hasSize(2); assertThat(getComponent(orchestrator, "com.sonarsource.it.samples:multi-modules-sample").getName()).isEqualTo("Sonar :: Integration Tests :: Multi-modules Sample"); assertThat(getComponent(orchestrator, "com.sonarsource.it.samples:multi-modules-sample:branch/0.x").getName()) .isEqualTo("Sonar :: Integration Tests :: Multi-modules Sample branch/0.x"); diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/ExecuteAnalysisPermissionTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/ExecuteAnalysisPermissionTest.java index 78f8cfc1e0a..3f3c0750f75 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/ExecuteAnalysisPermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/ExecuteAnalysisPermissionTest.java @@ -27,9 +27,9 @@ import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.sonarqube.qa.util.Tester; -import org.sonarqube.ws.client.permission.AddGroupWsRequest; -import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest; -import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; +import org.sonarqube.ws.client.permission.AddGroupRequest; +import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest; +import org.sonarqube.ws.client.permission.RemoveGroupRequest; import org.sonarqube.ws.client.project.UpdateVisibilityRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -112,7 +112,7 @@ public class ExecuteAnalysisPermissionTest { @Test public void execute_analysis_with_scan_on_default_template() { removeGlobalPermission("anyone", "scan"); - tester.wsClient().permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.builder() + tester.wsClient().permissions().addProjectCreatorToTemplate(AddProjectCreatorToTemplateRequest.builder() .setPermission("scan") .setTemplateId("default_template") .build()); @@ -121,15 +121,15 @@ public class ExecuteAnalysisPermissionTest { } private void addProjectPermission(String groupName, String projectKey, String permission) { - tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName(groupName).setProjectKey(projectKey).setPermission(permission)); + tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName(groupName).setProjectKey(projectKey).setPermission(permission)); } private void addGlobalPermission(String groupName, String permission) { - tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName(groupName).setPermission(permission)); + tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName(groupName).setPermission(permission)); } private void removeGlobalPermission(String groupName, String permission) { - tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setGroupName(groupName).setPermission(permission)); + tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setGroupName(groupName).setPermission(permission)); } private static void executeLoggedAnalysis() { diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/IssuePermissionTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/IssuePermissionTest.java index 910bb6124c2..d3734d24e05 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/IssuePermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/IssuePermissionTest.java @@ -33,7 +33,7 @@ import org.sonar.wsclient.user.UserParameters; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Issues; import org.sonarqube.ws.client.issue.BulkChangeRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.project.UpdateVisibilityRequest; import util.ItUtils; @@ -265,7 +265,7 @@ public class IssuePermissionTest { private void addUserPermission(String login, String projectKey, String permission) { tester.wsClient().permissions().addUser( - new AddUserWsRequest() + new AddUserRequest() .setLogin(login) .setProjectKey(projectKey) .setPermission(permission)); diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionSearchTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionSearchTest.java index f14d2264b71..77a24d84976 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionSearchTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionSearchTest.java @@ -30,18 +30,18 @@ import org.sonarqube.ws.Permissions; import org.sonarqube.ws.Permissions.Permission; import org.sonarqube.ws.Permissions.SearchTemplatesWsResponse; import org.sonarqube.ws.client.PostRequest; -import org.sonarqube.ws.client.permission.AddGroupToTemplateWsRequest; -import org.sonarqube.ws.client.permission.AddGroupWsRequest; -import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest; -import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; -import org.sonarqube.ws.client.permission.CreateTemplateWsRequest; -import org.sonarqube.ws.client.permission.GroupsWsRequest; -import org.sonarqube.ws.client.permission.RemoveGroupFromTemplateWsRequest; -import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequest; -import org.sonarqube.ws.client.permission.RemoveUserFromTemplateWsRequest; -import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest; -import org.sonarqube.ws.client.permission.UsersWsRequest; +import org.sonarqube.ws.client.permission.AddGroupToTemplateRequest; +import org.sonarqube.ws.client.permission.AddGroupRequest; +import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateRequest; +import org.sonarqube.ws.client.permission.AddUserToTemplateRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; +import org.sonarqube.ws.client.permission.CreateTemplateRequest; +import org.sonarqube.ws.client.permission.GroupsRequest; +import org.sonarqube.ws.client.permission.RemoveGroupFromTemplateRequest; +import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateRequest; +import org.sonarqube.ws.client.permission.RemoveUserFromTemplateRequest; +import org.sonarqube.ws.client.permission.SearchTemplatesRequest; +import org.sonarqube.ws.client.permission.UsersRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -79,11 +79,11 @@ public class PermissionSearchTest { @Test public void permission_web_services() { tester.wsClient().permissions().addUser( - new AddUserWsRequest() + new AddUserRequest() .setPermission("admin") .setLogin(LOGIN)); tester.wsClient().permissions().addGroup( - new AddGroupWsRequest() + new AddGroupRequest() .setPermission("admin") .setGroupName(GROUP_NAME)); @@ -94,11 +94,11 @@ public class PermissionSearchTest { assertThat(searchGlobalPermissionsWsResponse.getPermissionsList().get(0).getGroupsCount()).isEqualTo(2); Permissions.UsersWsResponse users = tester.wsClient().permissions() - .users(new UsersWsRequest().setPermission("admin")); + .users(new UsersRequest().setPermission("admin")); assertThat(users.getUsersList()).extracting("login").contains(LOGIN); Permissions.WsGroupsResponse groupsResponse = tester.wsClient().permissions() - .groups(new GroupsWsRequest() + .groups(new GroupsRequest() .setPermission("admin")); assertThat(groupsResponse.getGroupsList()).extracting("name").contains(GROUP_NAME); } @@ -106,31 +106,31 @@ public class PermissionSearchTest { @Test public void template_permission_web_services() { Permissions.CreateTemplateWsResponse createTemplateWsResponse = tester.wsClient().permissions().createTemplate( - new CreateTemplateWsRequest() + new CreateTemplateRequest() .setName("my-new-template") .setDescription("template-used-in-tests")); assertThat(createTemplateWsResponse.getPermissionTemplate().getName()).isEqualTo("my-new-template"); tester.wsClient().permissions().addUserToTemplate( - new AddUserToTemplateWsRequest() + new AddUserToTemplateRequest() .setPermission("admin") .setTemplateName("my-new-template") .setLogin(LOGIN)); tester.wsClient().permissions().addGroupToTemplate( - new AddGroupToTemplateWsRequest() + new AddGroupToTemplateRequest() .setPermission("admin") .setTemplateName("my-new-template") .setGroupName(GROUP_NAME)); tester.wsClient().permissions().addProjectCreatorToTemplate( - AddProjectCreatorToTemplateWsRequest.builder() + AddProjectCreatorToTemplateRequest.builder() .setPermission("admin") .setTemplateName("my-new-template") .build()); SearchTemplatesWsResponse searchTemplatesWsResponse = tester.wsClient().permissions().searchTemplates( - new SearchTemplatesWsRequest() + new SearchTemplatesRequest() .setQuery("my-new-template")); assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getName()).isEqualTo("my-new-template"); assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getPermissions(0).getKey()).isEqualTo("admin"); @@ -139,26 +139,26 @@ public class PermissionSearchTest { assertThat(searchTemplatesWsResponse.getPermissionTemplates(0).getPermissions(0).getWithProjectCreator()).isTrue(); tester.wsClient().permissions().removeGroupFromTemplate( - new RemoveGroupFromTemplateWsRequest() + new RemoveGroupFromTemplateRequest() .setPermission("admin") .setTemplateName("my-new-template") .setGroupName(GROUP_NAME)); tester.wsClient().permissions().removeUserFromTemplate( - new RemoveUserFromTemplateWsRequest() + new RemoveUserFromTemplateRequest() .setPermission("admin") .setTemplateName("my-new-template") .setLogin(LOGIN)); tester.wsClient().permissions().removeProjectCreatorFromTemplate( - RemoveProjectCreatorFromTemplateWsRequest.builder() + RemoveProjectCreatorFromTemplateRequest.builder() .setPermission("admin") .setTemplateName("my-new-template") .build() ); SearchTemplatesWsResponse clearedSearchTemplatesWsResponse = tester.wsClient().permissions().searchTemplates( - new SearchTemplatesWsRequest() + new SearchTemplatesRequest() .setQuery("my-new-template")); assertThat(clearedSearchTemplatesWsResponse.getPermissionTemplates(0).getPermissionsList()) .extracting(Permission::getUsersCount, Permission::getGroupsCount, Permission::getWithProjectCreator) diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplatePageTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplatePageTest.java index 8ef4d43e9f9..f5149f8c631 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplatePageTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplatePageTest.java @@ -26,9 +26,9 @@ import org.junit.Test; import org.sonarqube.qa.util.Tester; import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage; import org.sonarqube.ws.Permissions; -import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest; -import org.sonarqube.ws.client.permission.CreateTemplateWsRequest; -import org.sonarqube.ws.client.permission.UsersWsRequest; +import org.sonarqube.ws.client.permission.AddUserToTemplateRequest; +import org.sonarqube.ws.client.permission.CreateTemplateRequest; +import org.sonarqube.ws.client.permission.UsersRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -48,9 +48,9 @@ public class PermissionTemplatePageTest { String userLogin = tester.users().generateMemberOfDefaultOrganization().getLogin(); String adminLogin = tester.users().generateAdministratorOnDefaultOrganization().getLogin(); - tester.wsClient().permissions().createTemplate(new CreateTemplateWsRequest().setName("foo-template")); + tester.wsClient().permissions().createTemplate(new CreateTemplateRequest().setName("foo-template")); tester.wsClient().permissions().addUserToTemplate( - new AddUserToTemplateWsRequest() + new AddUserToTemplateRequest() .setPermission("admin") .setTemplateName("foo-template") .setLogin(userLogin)); @@ -58,7 +58,7 @@ public class PermissionTemplatePageTest { ProjectsManagementPage page = tester.openBrowser().logIn().submitCredentials(adminLogin).openProjectsManagement(); page.shouldHaveProject(project); page.bulkApplyPermissionTemplate("foo-template"); - Permissions.UsersWsResponse usersResponse = tester.wsClient().permissions().users(new UsersWsRequest() + Permissions.UsersWsResponse usersResponse = tester.wsClient().permissions().users(new UsersRequest() .setProjectKey(project) .setPermission("admin") ); diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplateTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplateTest.java index a0d4d4c7860..1f20a5b549a 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplateTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/PermissionTemplateTest.java @@ -38,12 +38,12 @@ import org.sonarqube.ws.Projects.CreateWsResponse.Project; import org.sonarqube.ws.Users.CreateWsResponse; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.component.SearchProjectsRequest; -import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest; -import org.sonarqube.ws.client.permission.ApplyTemplateWsRequest; -import org.sonarqube.ws.client.permission.BulkApplyTemplateWsRequest; -import org.sonarqube.ws.client.permission.CreateTemplateWsRequest; +import org.sonarqube.ws.client.permission.AddUserToTemplateRequest; +import org.sonarqube.ws.client.permission.ApplyTemplateRequest; +import org.sonarqube.ws.client.permission.BulkApplyTemplateRequest; +import org.sonarqube.ws.client.permission.CreateTemplateRequest; import org.sonarqube.ws.client.permission.PermissionsService; -import org.sonarqube.ws.client.permission.UsersWsRequest; +import org.sonarqube.ws.client.permission.UsersRequest; import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic; import static org.assertj.core.api.Assertions.assertThat; @@ -90,7 +90,7 @@ public class PermissionTemplateTest { CreateWsResponse.User user = tester.users().generateMember(organization); CreateWsResponse.User anotherUser = tester.users().generateMember(organization); Permissions.PermissionTemplate template = createTemplate(organization).getPermissionTemplate(); - tester.wsClient().permissions().addUserToTemplate(new AddUserToTemplateWsRequest() + tester.wsClient().permissions().addUserToTemplate(new AddUserToTemplateRequest() .setOrganization(organization.getKey()) .setTemplateId(template.getId()) .setLogin(user.getLogin()) @@ -99,7 +99,7 @@ public class PermissionTemplateTest { Project project2 = createPrivateProject(organization); Project untouchedProject = createPrivateProject(organization); - tester.wsClient().permissions().bulkApplyTemplate(new BulkApplyTemplateWsRequest() + tester.wsClient().permissions().bulkApplyTemplate(new BulkApplyTemplateRequest() .setOrganization(organization.getKey()) .setTemplateId(template.getId()) .setProjects(Arrays.asList(project1.getKey(), project2.getKey()))); @@ -157,23 +157,23 @@ public class PermissionTemplateTest { private void createAndApplyTemplate(Organization organization, Project project, CreateWsResponse.User user) { String templateName = "For user"; PermissionsService service = tester.wsClient().permissions(); - service.createTemplate(new CreateTemplateWsRequest() + service.createTemplate(new CreateTemplateRequest() .setOrganization(organization.getKey()) .setName(templateName) .setDescription("Give admin permissions to single user")); - service.addUserToTemplate(new AddUserToTemplateWsRequest() + service.addUserToTemplate(new AddUserToTemplateRequest() .setOrganization(organization.getKey()) .setLogin(user.getLogin()) .setPermission("user") .setTemplateName(templateName)); - service.applyTemplate(new ApplyTemplateWsRequest() + service.applyTemplate(new ApplyTemplateRequest() .setOrganization(organization.getKey()) .setProjectKey(project.getKey()) .setTemplateName(templateName)); } private CreateTemplateWsResponse createTemplate(Organization organization) { - return tester.wsClient().permissions().createTemplate(new CreateTemplateWsRequest() + return tester.wsClient().permissions().createTemplate(new CreateTemplateRequest() .setOrganization(organization.getKey()) .setName(randomAlphabetic(20))); } @@ -199,7 +199,7 @@ public class PermissionTemplateTest { } private boolean hasBrowsePermission(CreateWsResponse.User user, Organization organization, Project project) { - UsersWsRequest request = new UsersWsRequest() + UsersRequest request = new UsersRequest() .setOrganization(organization.getKey()) .setProjectKey(project.getKey()) .setPermission("user"); diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/ProvisioningPermissionTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/ProvisioningPermissionTest.java index 3a9da8f55a0..f2dd1d9a704 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/ProvisioningPermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/ProvisioningPermissionTest.java @@ -27,10 +27,10 @@ import org.junit.Test; import org.junit.rules.RuleChain; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Projects.CreateWsResponse.Project; -import org.sonarqube.ws.client.permission.AddGroupWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; -import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; -import org.sonarqube.ws.client.permission.RemoveUserWsRequest; +import org.sonarqube.ws.client.permission.AddGroupRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; +import org.sonarqube.ws.client.permission.RemoveGroupRequest; +import org.sonarqube.ws.client.permission.RemoveUserRequest; import org.sonarqube.ws.client.project.CreateRequest; import util.ItUtils; @@ -58,7 +58,7 @@ public class ProvisioningPermissionTest { @BeforeClass public static void init() { // remove default permission "provisioning" from anyone(); - tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setGroupName("anyone").setPermission("provisioning")); + tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setGroupName("anyone").setPermission("provisioning")); tester.users().generate(u -> u.setLogin(ADMIN_WITH_PROVISIONING).setPassword(PASSWORD)); addUserPermission(ADMIN_WITH_PROVISIONING, "admin"); @@ -77,7 +77,7 @@ public class ProvisioningPermissionTest { @AfterClass public static void restoreData() throws Exception { - tester.wsClient().permissions().addGroup(new AddGroupWsRequest().setGroupName("anyone").setPermission("provisioning")); + tester.wsClient().permissions().addGroup(new AddGroupRequest().setGroupName("anyone").setPermission("provisioning")); } /** @@ -130,10 +130,10 @@ public class ProvisioningPermissionTest { } private static void addUserPermission(String login, String permission) { - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission(permission)); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(login).setPermission(permission)); } private static void removeUserPermission(String login, String permission) { - tester.wsClient().permissions().removeUser(new RemoveUserWsRequest().setLogin(login).setPermission(permission)); + tester.wsClient().permissions().removeUser(new RemoveUserRequest().setLogin(login).setPermission(permission)); } } diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/QualityProfileAdminPermissionTest.java b/tests/src/test/java/org/sonarqube/tests/authorization/QualityProfileAdminPermissionTest.java index 97d784d596a..c06e735a031 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/QualityProfileAdminPermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/QualityProfileAdminPermissionTest.java @@ -24,7 +24,7 @@ import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.sonarqube.qa.util.Tester; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.qualityprofile.CreateRequest; import util.selenium.Selenese; @@ -49,7 +49,7 @@ public class QualityProfileAdminPermissionTest { tester.users().generate(u -> u.setLogin("not_profileadm").setPassword("userpwd")); tester.users().generate(u -> u.setLogin("profileadm").setPassword("papwd")); - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin("profileadm").setPermission("profileadmin")); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin("profileadm").setPermission("profileadmin")); createProfile("xoo", "foo"); Selenese.runSelenese(orchestrator, diff --git a/tests/src/test/java/org/sonarqube/tests/ce/ReportFailureNotificationTest.java b/tests/src/test/java/org/sonarqube/tests/ce/ReportFailureNotificationTest.java index ed6f9c9f82f..ccb74e981ec 100644 --- a/tests/src/test/java/org/sonarqube/tests/ce/ReportFailureNotificationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/ce/ReportFailureNotificationTest.java @@ -48,7 +48,7 @@ import org.sonarqube.ws.Projects; import org.sonarqube.ws.Users; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.subethamail.wiser.Wiser; import org.subethamail.wiser.WiserMessage; @@ -109,12 +109,12 @@ public class ReportFailureNotificationTest { Projects.CreateWsResponse.Project project2 = tester.projects().provision(organization, t -> t.setName("Project2")); Projects.CreateWsResponse.Project project3 = tester.projects().provision(organization, t -> t.setName("Project3")); // user 1 is admin of project 1 and will subscribe to global notifications - tester.wsClient().permissions().addUser(new AddUserWsRequest() + tester.wsClient().permissions().addUser(new AddUserRequest() .setLogin(user1.getLogin()) .setPermission("admin") .setProjectKey(project1.getKey())); // user 2 is admin of project 2 but won't subscribe to global notifications - tester.wsClient().permissions().addUser(new AddUserWsRequest() + tester.wsClient().permissions().addUser(new AddUserRequest() .setLogin(user2.getLogin()) .setPermission("admin") .setProjectKey(project2.getKey())); diff --git a/tests/src/test/java/org/sonarqube/tests/component/ComponentsWsTest.java b/tests/src/test/java/org/sonarqube/tests/component/ComponentsWsTest.java index 81a621d0e05..a14c73445df 100644 --- a/tests/src/test/java/org/sonarqube/tests/component/ComponentsWsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/component/ComponentsWsTest.java @@ -27,8 +27,8 @@ import org.junit.Test; import org.junit.rules.RuleChain; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Components; -import org.sonarqube.ws.client.component.SearchWsRequest; -import org.sonarqube.ws.client.component.ShowWsRequest; +import org.sonarqube.ws.client.component.SearchRequest; +import org.sonarqube.ws.client.component.ShowRequest; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; @@ -53,7 +53,7 @@ public class ComponentsWsTest { @Test public void show() { - Components.ShowWsResponse response = tester.wsClient().components().show(new ShowWsRequest().setKey(FILE_KEY)); + Components.ShowWsResponse response = tester.wsClient().components().show(new ShowRequest().setKey(FILE_KEY)); assertThat(response).isNotNull(); assertThat(response.getComponent().getKey()).isEqualTo(FILE_KEY); @@ -62,7 +62,7 @@ public class ComponentsWsTest { @Test public void search() { - Components.SearchWsResponse response = tester.wsClient().components().search(new SearchWsRequest() + Components.SearchWsResponse response = tester.wsClient().components().search(new SearchRequest() .setQualifiers(singletonList("FIL"))); assertThat(response).isNotNull(); diff --git a/tests/src/test/java/org/sonarqube/tests/duplication/CrossProjectDuplicationsTest.java b/tests/src/test/java/org/sonarqube/tests/duplication/CrossProjectDuplicationsTest.java index 10d46f72611..934b045de47 100644 --- a/tests/src/test/java/org/sonarqube/tests/duplication/CrossProjectDuplicationsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/duplication/CrossProjectDuplicationsTest.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.junit.rules.RuleChain; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.client.GetRequest; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import util.issue.IssueRule; @@ -94,7 +94,7 @@ public class CrossProjectDuplicationsTest { @Test public void issue_on_duplicated_blocks_is_generated_on_file() throws Exception { - assertThat(issueRule.search(new SearchWsRequest().setComponentKeys(singletonList(DUPLICATE_FILE)).setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()) + assertThat(issueRule.search(new SearchRequest().setComponentKeys(singletonList(DUPLICATE_FILE)).setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()) .hasSize(1); } diff --git a/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationsTest.java b/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationsTest.java index 671513c579a..0efe0c0837b 100644 --- a/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationsTest.java @@ -30,7 +30,7 @@ import org.junit.rules.RuleChain; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import util.issue.IssueRule; @@ -153,7 +153,7 @@ public class DuplicationsTest { @Test public void issues_on_duplicated_blocks_are_generated_on_each_file() throws Exception { - assertThat(issueRule.search(new SearchWsRequest().setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()).hasSize(13); + assertThat(issueRule.search(new SearchRequest().setRules(singletonList("common-xoo:DuplicatedBlocks"))).getIssuesList()).hasSize(13); } @Test diff --git a/tests/src/test/java/org/sonarqube/tests/issue/CommonRulesTest.java b/tests/src/test/java/org/sonarqube/tests/issue/CommonRulesTest.java index 69cddb89b7a..e5a8aee0e5f 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/CommonRulesTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/CommonRulesTest.java @@ -24,7 +24,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.sonarqube.ws.Issues.Issue; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -87,7 +87,7 @@ public class CommonRulesTest extends AbstractIssueTest { private List findIssues(String componentKey, String ruleKey) { return adminWsClient.issues().search( - new SearchWsRequest() + new SearchRequest() .setComponents(singletonList(componentKey)) .setRules(singletonList(ruleKey))) .getIssuesList(); diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueActionTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueActionTest.java index 6ef4ae9573e..dbb4d6eef17 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueActionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueActionTest.java @@ -30,7 +30,7 @@ import org.sonarqube.ws.client.issue.AddCommentRequest; import org.sonarqube.ws.client.issue.AssignRequest; import org.sonarqube.ws.client.issue.EditCommentRequest; import org.sonarqube.ws.client.issue.IssuesService; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import org.sonarqube.ws.client.issue.SetSeverityRequest; import util.ProjectAnalysis; import util.ProjectAnalysisRule; @@ -157,18 +157,18 @@ public class IssueActionTest extends AbstractIssueTest { @Test public void assign() { assertThat(randomIssue.hasAssignee()).isFalse(); - Issues.SearchWsResponse response = issueRule.search(new SearchWsRequest().setIssues(singletonList(randomIssue.getKey()))); + Issues.SearchWsResponse response = issueRule.search(new SearchRequest().setIssues(singletonList(randomIssue.getKey()))); assertThat(response.getUsers().getUsersList()).isEmpty(); issuesService.assign(new AssignRequest(randomIssue.getKey(), "admin")); - assertThat(issueRule.search(new SearchWsRequest().setAssignees(singletonList("admin"))).getIssuesList()).hasSize(1); + assertThat(issueRule.search(new SearchRequest().setAssignees(singletonList("admin"))).getIssuesList()).hasSize(1); projectAnalysis.run(); Issue reloaded = issueRule.getByKey(randomIssue.getKey()); assertThat(reloaded.getAssignee()).isEqualTo("admin"); assertThat(reloaded.getCreationDate()).isEqualTo(randomIssue.getCreationDate()); - response = issueRule.search(new SearchWsRequest().setIssues(singletonList(randomIssue.getKey())).setAdditionalFields(singletonList("users"))); + response = issueRule.search(new SearchRequest().setIssues(singletonList(randomIssue.getKey())).setAdditionalFields(singletonList("users"))); assertThat(response.getUsers().getUsersList().stream().filter(user -> "admin".equals(user.getLogin())).findFirst()).isPresent(); assertThat(response.getUsers().getUsersList().stream().filter(user -> "Administrator".equals(user.getName())).findFirst()).isPresent(); @@ -176,7 +176,7 @@ public class IssueActionTest extends AbstractIssueTest { issuesService.assign(new AssignRequest(randomIssue.getKey(), null)); reloaded = issueRule.getByKey(randomIssue.getKey()); assertThat(reloaded.hasAssignee()).isFalse(); - assertThat(issueRule.search(new SearchWsRequest().setAssignees(singletonList("admin"))).getIssuesList()).isEmpty(); + assertThat(issueRule.search(new SearchRequest().setAssignees(singletonList("admin"))).getIssuesList()).isEmpty(); } /** @@ -194,7 +194,7 @@ public class IssueActionTest extends AbstractIssueTest { } private static List searchIssuesBySeverities(String projectKey, String severity) { - return issueRule.search(new SearchWsRequest().setProjectKeys(singletonList(projectKey)).setSeverities(singletonList(severity))).getIssuesList(); + return issueRule.search(new SearchRequest().setProjectKeys(singletonList(projectKey)).setSeverities(singletonList(severity))).getIssuesList(); } } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueBulkChangeTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueBulkChangeTest.java index b62cf49a22c..4c4fd88cf2d 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueBulkChangeTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueBulkChangeTest.java @@ -31,7 +31,7 @@ import org.sonarqube.ws.Issues; import org.sonarqube.ws.Issues.BulkChangeWsResponse; import org.sonarqube.ws.client.issue.BulkChangeRequest; import org.sonarqube.ws.client.issue.IssuesService; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ProjectAnalysis; import util.ProjectAnalysisRule; import util.issue.IssueRule; @@ -259,7 +259,7 @@ public class IssueBulkChangeTest extends AbstractIssueTest { } private static String[] searchIssueKeys(int limit) { - return getIssueKeys(issueRule.search(new SearchWsRequest()).getIssuesList(), limit); + return getIssueKeys(issueRule.search(new SearchRequest()).getIssuesList(), limit); } private static String[] getIssueKeys(List issues, int nbIssues) { diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueFilterOnCommonRulesTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueFilterOnCommonRulesTest.java index 8012aec2ef7..a7a8708a382 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueFilterOnCommonRulesTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueFilterOnCommonRulesTest.java @@ -25,7 +25,7 @@ import org.junit.Before; import org.junit.Test; import org.sonarqube.ws.Issues; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -113,14 +113,14 @@ public class IssueFilterOnCommonRulesTest extends AbstractIssueTest { private List findIssuesByRuleKey(String ruleKey) { return adminWsClient.issues().search( - new SearchWsRequest() + new SearchRequest() .setComponents(singletonList(FILE_KEY)) .setRules(singletonList(ruleKey))) .getIssuesList(); } private List findAllIssues() { - return adminWsClient.issues().search(new SearchWsRequest()).getIssuesList(); + return adminWsClient.issues().search(new SearchRequest()).getIssuesList(); } } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueNotificationsTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueNotificationsTest.java index b5bcef07954..529191d7145 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueNotificationsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueNotificationsTest.java @@ -52,8 +52,8 @@ import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.issue.AssignRequest; import org.sonarqube.ws.client.issue.BulkChangeRequest; -import org.sonarqube.ws.client.issue.SearchWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.subethamail.wiser.Wiser; import org.subethamail.wiser.WiserMessage; @@ -174,7 +174,7 @@ public class IssueNotificationsTest { clearSmtpMessages(); // Change assignee - SearchWsResponse issues = tester.wsClient().issues().search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY))); + SearchWsResponse issues = tester.wsClient().issues().search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY))); Issue issue = issues.getIssuesList().get(0); tester.wsClient().issues().assign(new AssignRequest(issue.getKey(), userWithUserRole.getLogin())); @@ -245,7 +245,7 @@ public class IssueNotificationsTest { assertThat(smtpServer.getMessages()).hasSize(privateProject ? 2 : 3); clearSmtpMessages(); - SearchWsResponse issues = tester.wsClient().issues().search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY))); + SearchWsResponse issues = tester.wsClient().issues().search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY))); Issue issue = issues.getIssuesList().get(0); // bulk change without notification by default @@ -307,7 +307,7 @@ public class IssueNotificationsTest { .setEmail("userWithUserRole@nowhere.com")); tester.organizations().addMember(organization, userWithUserRole); tester.wsClient().permissions().addUser( - new AddUserWsRequest() + new AddUserRequest() .setLogin(userWithUserRole.getLogin()) .setProjectKey(PROJECT_KEY) .setPermission("user")); diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueSearchTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueSearchTest.java index 1ad0be32cd9..a6984ddb4eb 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueSearchTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueSearchTest.java @@ -35,7 +35,7 @@ import org.sonar.wsclient.issue.Issue; import org.sonar.wsclient.issue.IssueQuery; import org.sonar.wsclient.issue.Issues; import org.sonarqube.ws.Common; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static java.util.Arrays.asList; @@ -261,16 +261,16 @@ public class IssueSearchTest extends AbstractIssueTest { @Test public void search_issues_by_types() throws IOException { - assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("CODE_SMELL"))).getPaging().getTotal()).isEqualTo(142); - assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("BUG"))).getPaging().getTotal()).isEqualTo(122); - assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8); + assertThat(searchIssues(new SearchRequest().setTypes(singletonList("CODE_SMELL"))).getPaging().getTotal()).isEqualTo(142); + assertThat(searchIssues(new SearchRequest().setTypes(singletonList("BUG"))).getPaging().getTotal()).isEqualTo(122); + assertThat(searchIssues(new SearchRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8); } private List searchByRuleKey(String... ruleKey) throws IOException { - return searchIssues(new SearchWsRequest().setRules(asList(ruleKey))).getIssuesList(); + return searchIssues(new SearchRequest().setRules(asList(ruleKey))).getIssuesList(); } - private SearchWsResponse searchIssues(SearchWsRequest request) throws IOException { + private SearchWsResponse searchIssues(SearchRequest request) throws IOException { return newAdminWsClient(ORCHESTRATOR).issues().search(request); } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueTagsTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueTagsTest.java index e802dc945ac..2e4f00e1885 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueTagsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueTagsTest.java @@ -32,8 +32,8 @@ import org.junit.Test; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Organizations.Organization; import org.sonarqube.ws.Users.CreateWsResponse.User; -import org.sonarqube.ws.client.issue.SearchWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.project.CreateRequest; import util.ItUtils; @@ -75,7 +75,7 @@ public class IssueTagsTest { .build()); analyzeProject(projectKey); - String issue = tester.wsClient().issues().search(new SearchWsRequest()).getIssues(0).getKey(); + String issue = tester.wsClient().issues().search(new SearchRequest()).getIssues(0).getKey(); tester.wsClient().issues().setTags(issue, "bla", "blubb"); String[] publicTags = {"bad-practice", "convention", "pitfall"}; @@ -112,7 +112,7 @@ public class IssueTagsTest { private void grantUserPermission(String projectKey, User member) { tester.wsClient().permissions().addUser( - new AddUserWsRequest() + new AddUserRequest() .setLogin(member.getLogin()) .setPermission("user") .setProjectKey(projectKey)); diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueTrackingTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueTrackingTest.java index 27a9ed0e80f..632cfa5d810 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueTrackingTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueTrackingTest.java @@ -27,7 +27,7 @@ import org.junit.Test; import org.sonarqube.ws.Issues.Issue; import org.sonarqube.ws.Issues.SearchWsResponse; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -71,7 +71,7 @@ public class IssueTrackingTest extends AbstractIssueTest { "sonar.projectDate", NEW_DATE_STR, "sonar.exclusions", "**/*.xoo"); - issues = searchIssues(new SearchWsRequest().setProjectKeys(singletonList("sample"))).getIssuesList(); + issues = searchIssues(new SearchRequest().setProjectKeys(singletonList("sample"))).getIssuesList(); assertThat(issues).hasSize(1); assertThat(issues.get(0).getStatus()).isEqualTo("CLOSED"); assertThat(issues.get(0).getResolution()).isEqualTo("FIXED"); @@ -119,14 +119,14 @@ public class IssueTrackingTest extends AbstractIssueTest { runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample"); // Only one issue is created - assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(1); + assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(1); Issue issue = getRandomIssue(); // Re analysis of the same project runProjectAnalysis(ORCHESTRATOR, "shared/xoo-sample"); // No new issue should be created - assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(1); + assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(1); // The issue on module should stay open and be the same from the first analysis Issue reloadIssue = getIssueByKey(issue.getKey()); @@ -146,14 +146,14 @@ public class IssueTrackingTest extends AbstractIssueTest { runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample"); // One issue by module are created - List issues = searchIssues(new SearchWsRequest()).getIssuesList(); + List issues = searchIssues(new SearchRequest()).getIssuesList(); assertThat(issues).hasSize(4); // Re analysis of the same project runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample"); // No new issue should be created - assertThat(searchIssues(new SearchWsRequest()).getIssuesList()).hasSize(issues.size()); + assertThat(searchIssues(new SearchRequest()).getIssuesList()).hasSize(issues.size()); // Issues on modules should stay open and be the same from the first analysis for (Issue issue : issues) { @@ -200,20 +200,20 @@ public class IssueTrackingTest extends AbstractIssueTest { } private List searchUnresolvedIssuesByComponent(String componentKey) { - return searchIssues(new SearchWsRequest().setComponentKeys(singletonList(componentKey)).setResolved(false)).getIssuesList(); + return searchIssues(new SearchRequest().setComponentKeys(singletonList(componentKey)).setResolved(false)).getIssuesList(); } private static Issue getRandomIssue() { - return searchIssues(new SearchWsRequest()).getIssues(0); + return searchIssues(new SearchRequest()).getIssues(0); } private static Issue getIssueByKey(String issueKey) { - SearchWsResponse search = searchIssues(new SearchWsRequest().setIssues(singletonList(issueKey))); + SearchWsResponse search = searchIssues(new SearchRequest().setIssues(singletonList(issueKey))); assertThat(search.getTotal()).isEqualTo(1); return search.getIssues(0); } - private static SearchWsResponse searchIssues(SearchWsRequest request) { + private static SearchWsResponse searchIssues(SearchRequest request) { return adminClient.issues().search(request); } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueWorkflowTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueWorkflowTest.java index bfcd4afca84..47db3ad031c 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueWorkflowTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueWorkflowTest.java @@ -28,7 +28,7 @@ import org.sonarqube.ws.Issues; import org.sonarqube.ws.Issues.Issue; import org.sonarqube.ws.client.issue.DoTransitionRequest; import org.sonarqube.ws.client.issue.IssuesService; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ProjectAnalysis; import util.ProjectAnalysisRule; import util.issue.IssueRule; @@ -70,7 +70,7 @@ public class IssueWorkflowTest extends AbstractIssueTest { */ @Test public void issue_is_closed_as_removed_when_rule_is_disabled() throws Exception { - SearchWsRequest ruleSearchRequest = new SearchWsRequest().setRules(singletonList("xoo:OneIssuePerLine")); + SearchRequest ruleSearchRequest = new SearchRequest().setRules(singletonList("xoo:OneIssuePerLine")); List issues = issueRule.search(ruleSearchRequest).getIssuesList(); assertThat(issues).isNotEmpty(); @@ -302,12 +302,12 @@ public class IssueWorkflowTest extends AbstractIssueTest { } private List transitions(String issueKey) { - Issues.SearchWsResponse response = searchIssues(new SearchWsRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("transitions"))); + Issues.SearchWsResponse response = searchIssues(new SearchRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("transitions"))); assertThat(response.getTotal()).isEqualTo(1); return response.getIssues(0).getTransitions().getTransitionsList(); } - private Issues.SearchWsResponse searchIssues(SearchWsRequest request) { + private Issues.SearchWsResponse searchIssues(SearchRequest request) { return newAdminWsClient(ORCHESTRATOR).issues().search(request); } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java index db359df1056..2f223fe66a1 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java @@ -35,7 +35,7 @@ import org.sonarqube.ws.Organizations; import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.issue.AssignRequest; import org.sonarqube.ws.client.issue.BulkChangeRequest; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import org.sonarqube.ws.client.project.CreateRequest; import org.sonarqube.ws.client.qualityprofile.AddProjectRequest; import org.sonarqube.qa.util.pageobjects.issues.IssuesPage; @@ -125,15 +125,15 @@ public class OrganizationIssueAssignTest { tester.organizations().addMember(org1, user); provisionAndAnalyseProject(SAMPLE_PROJECT_KEY, org1.getKey()); provisionAndAnalyseProject("sample2", org2.getKey()); - List issues = issueRule.search(new org.sonarqube.ws.client.issue.SearchWsRequest()).getIssuesList().stream().map(Issue::getKey).collect(Collectors.toList()); + List issues = issueRule.search(new SearchRequest()).getIssuesList().stream().map(Issue::getKey).collect(Collectors.toList()); Issues.BulkChangeWsResponse response = tester.wsClient().issues() .bulkChange(BulkChangeRequest.builder().setIssues(issues).setAssign(user.getLogin()).build()); assertThat(response.getIgnored()).isGreaterThan(0); - assertThat(issueRule.search(new SearchWsRequest().setProjectKeys(singletonList("sample"))).getIssuesList()).extracting(Issue::getAssignee) + assertThat(issueRule.search(new SearchRequest().setProjectKeys(singletonList("sample"))).getIssuesList()).extracting(Issue::getAssignee) .containsOnly(user.getLogin()); - assertThat(issueRule.search(new SearchWsRequest().setProjectKeys(singletonList("sample2"))).getIssuesList()).extracting(Issue::hasAssignee) + assertThat(issueRule.search(new SearchRequest().setProjectKeys(singletonList("sample2"))).getIssuesList()).extracting(Issue::hasAssignee) .containsOnly(false); } diff --git a/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java b/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java index 66245b7259e..84c4c4c1bf3 100644 --- a/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java +++ b/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java @@ -28,11 +28,11 @@ import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Issues; import org.sonarqube.ws.Components; import org.sonarqube.ws.Measures; -import org.sonarqube.ws.client.component.TreeWsRequest; +import org.sonarqube.ws.client.component.TreeRequest; import org.sonarqube.ws.client.issue.IssuesService; -import org.sonarqube.ws.client.issue.SearchWsRequest; -import org.sonarqube.ws.client.measure.ComponentTreeWsRequest; -import org.sonarqube.ws.client.measure.ComponentWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; +import org.sonarqube.ws.client.measure.ComponentTreeRequest; +import org.sonarqube.ws.client.measure.ComponentRequest; import org.sonarqube.ws.client.measure.MeasuresService; import static java.util.Arrays.asList; @@ -64,18 +64,18 @@ public class LiteTest { public void call_issues_ws() { // all issues IssuesService issuesService = tester.wsClient().issues(); - Issues.SearchWsResponse response = issuesService.search(new SearchWsRequest()); + Issues.SearchWsResponse response = issuesService.search(new SearchRequest()); assertThat(response.getIssuesCount()).isGreaterThan(0); // project issues - response = issuesService.search(new SearchWsRequest().setProjectKeys(singletonList(PROJECT_KEY))); + response = issuesService.search(new SearchRequest().setProjectKeys(singletonList(PROJECT_KEY))); assertThat(response.getIssuesCount()).isGreaterThan(0); } @Test public void call_components_ws() { // files in project - Components.TreeWsResponse tree = tester.wsClient().components().tree(new TreeWsRequest() + Components.TreeWsResponse tree = tester.wsClient().components().tree(new TreeRequest() .setBaseComponentKey(PROJECT_KEY) .setQualifiers(singletonList("FIL"))); assertThat(tree.getComponentsCount()).isEqualTo(4); @@ -89,13 +89,13 @@ public class LiteTest { public void call_measures_ws() { // project measures MeasuresService measuresService = tester.wsClient().measures(); - Measures.ComponentWsResponse component = measuresService.component(new ComponentWsRequest() + Measures.ComponentWsResponse component = measuresService.component(new ComponentRequest() .setComponentKey(PROJECT_KEY) .setMetricKeys(asList("lines", "ncloc", "files"))); assertThat(component.getComponent().getMeasuresCount()).isEqualTo(3); // file measures - Measures.ComponentTreeWsResponse tree = measuresService.componentTree(new ComponentTreeWsRequest() + Measures.ComponentTreeWsResponse tree = measuresService.componentTree(new ComponentTreeRequest() .setBaseComponentKey(PROJECT_KEY) .setQualifiers(singletonList("FIL")) .setMetricKeys(asList("lines", "ncloc"))); diff --git a/tests/src/test/java/org/sonarqube/tests/measure/MeasuresWsTest.java b/tests/src/test/java/org/sonarqube/tests/measure/MeasuresWsTest.java index e83ab8f5c8a..71f1460addf 100644 --- a/tests/src/test/java/org/sonarqube/tests/measure/MeasuresWsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/measure/MeasuresWsTest.java @@ -30,8 +30,8 @@ import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Measures; import org.sonarqube.ws.Measures.ComponentTreeWsResponse; import org.sonarqube.ws.Measures.ComponentWsResponse; -import org.sonarqube.ws.client.measure.ComponentTreeWsRequest; -import org.sonarqube.ws.client.measure.ComponentWsRequest; +import org.sonarqube.ws.client.measure.ComponentTreeRequest; +import org.sonarqube.ws.client.measure.ComponentRequest; import static com.google.common.collect.Lists.newArrayList; import static java.util.Arrays.asList; @@ -59,7 +59,7 @@ public class MeasuresWsTest { public void component_tree() { scanXooSample(); - ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeWsRequest() + ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeRequest() .setComponent("sample") .setMetricKeys(singletonList("ncloc")) .setAdditionalFields(asList("metrics", "periods"))); @@ -123,7 +123,7 @@ public class MeasuresWsTest { } private void verifyComponentTreeWithChildren(String baseComponentKey, String... childKeys) { - ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeWsRequest() + ComponentTreeWsResponse response = tester.wsClient().measures().componentTree(new ComponentTreeRequest() .setComponent(baseComponentKey) .setMetricKeys(singletonList("ncloc")) .setStrategy("children")); @@ -137,7 +137,7 @@ public class MeasuresWsTest { public void component() { scanXooSample(); - ComponentWsResponse response = tester.wsClient().measures().component(new ComponentWsRequest() + ComponentWsResponse response = tester.wsClient().measures().component(new ComponentRequest() .setComponent("sample") .setMetricKeys(singletonList("ncloc")) .setAdditionalFields(newArrayList("metrics", "periods"))); diff --git a/tests/src/test/java/org/sonarqube/tests/organization/BillingTest.java b/tests/src/test/java/org/sonarqube/tests/organization/BillingTest.java index 33c6de854b8..3ee724c08a4 100644 --- a/tests/src/test/java/org/sonarqube/tests/organization/BillingTest.java +++ b/tests/src/test/java/org/sonarqube/tests/organization/BillingTest.java @@ -34,7 +34,7 @@ import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; import org.sonarqube.ws.client.ce.TaskRequest; -import org.sonarqube.ws.client.organization.UpdateProjectVisibilityWsRequest; +import org.sonarqube.ws.client.organization.UpdateProjectVisibilityRequest; import org.sonarqube.ws.client.project.CreateRequest; import org.sonarqube.ws.client.project.UpdateVisibilityRequest; import util.ItUtils; @@ -127,7 +127,7 @@ public class BillingTest { public void does_not_fail_to_update_default_projects_visibility_to_private() { tester.settings().setGlobalSettings("sonar.billing.preventUpdatingProjectsVisibilityToPrivate", "false"); - tester.wsClient().organizations().updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder() + tester.wsClient().organizations().updateProjectVisibility(UpdateProjectVisibilityRequest.builder() .setOrganization(organization.getKey()) .setProjectVisibility("private") .build()); @@ -143,7 +143,7 @@ public class BillingTest { expectHttpError(400, format("Organization %s cannot use private project", organization.getKey()), () -> tester.wsClient().organizations() - .updateProjectVisibility(UpdateProjectVisibilityWsRequest.builder().setOrganization(organization.getKey()).setProjectVisibility("private").build())); + .updateProjectVisibility(UpdateProjectVisibilityRequest.builder().setOrganization(organization.getKey()).setProjectVisibility("private").build())); } @Test diff --git a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationMembershipTest.java b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationMembershipTest.java index 2b738c24afd..27168955514 100644 --- a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationMembershipTest.java +++ b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationMembershipTest.java @@ -31,7 +31,7 @@ import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Organizations.Organization; import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.HttpException; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; public class OrganizationMembershipTest { @@ -78,7 +78,7 @@ public class OrganizationMembershipTest { User user = tester.users().generate(); addMembership(organization, user); - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey())); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey())); tester.organizations().assertThatMemberOf(organization, user); removeMembership(organization, user); @@ -91,7 +91,7 @@ public class OrganizationMembershipTest { User user = tester.users().generate(); addMembership(organization, user); - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey())); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey())); tester.organizations().assertThatMemberOf(organization, user); // Admin is the creator of the organization so he was granted with admin permission tester.wsClient().organizations().removeMember(organization.getKey(), "admin"); diff --git a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationTest.java b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationTest.java index a0067d75aa1..8995f90a42d 100644 --- a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationTest.java @@ -37,11 +37,11 @@ import org.sonarqube.ws.UserGroups.Group; import org.sonarqube.ws.Users; import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.component.ComponentsService; -import org.sonarqube.ws.client.organization.CreateWsRequest; +import org.sonarqube.ws.client.organization.CreateRequest; import org.sonarqube.ws.client.organization.OrganizationService; -import org.sonarqube.ws.client.organization.SearchWsRequest; -import org.sonarqube.ws.client.organization.UpdateWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.organization.SearchRequest; +import org.sonarqube.ws.client.organization.UpdateRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.permission.PermissionsService; import org.sonarqube.ws.client.roots.SetRootRequest; import org.sonarqube.ws.client.roots.UnsetRootRequest; @@ -77,7 +77,7 @@ public class OrganizationTest { @Test public void default_organization_should_exist() { - Organization defaultOrg = tester.organizations().service().search(SearchWsRequest.builder().build()) + Organization defaultOrg = tester.organizations().service().search(SearchRequest.builder().build()) .getOrganizationsList() .stream() .filter(Organization::getGuarded) @@ -111,7 +111,7 @@ public class OrganizationTest { assertThatBuiltInQualityProfilesExist(org); // update by key - service.update(new UpdateWsRequest.Builder() + service.update(new UpdateRequest.Builder() .setKey(org.getKey()) .setName("new name") .setDescription("new description") @@ -121,7 +121,7 @@ public class OrganizationTest { verifyOrganization(org, "new name", "new description", "new url", "new avatar url"); // remove optional fields - service.update(new UpdateWsRequest.Builder() + service.update(new UpdateRequest.Builder() .setKey(org.getKey()) .setName("new name 2") .setDescription("") @@ -136,7 +136,7 @@ public class OrganizationTest { assertThatQualityProfilesDoNotExist(org); // create again - service.create(new CreateWsRequest.Builder() + service.create(new CreateRequest.Builder() .setName(NAME) .setKey(org.getKey()) .build()) @@ -149,7 +149,7 @@ public class OrganizationTest { // create organization without key String name = "Foo Company to keyize"; String expectedKey = "foo-company-to-keyize"; - Organization createdOrganization = tester.organizations().service().create(new CreateWsRequest.Builder() + Organization createdOrganization = tester.organizations().service().create(new CreateRequest.Builder() .setName(name) .build()) .getOrganization(); @@ -163,7 +163,7 @@ public class OrganizationTest { OrganizationTester anonymousTester = tester.asAnonymous().organizations(); expectForbiddenError(() -> anonymousTester.generate()); - expectUnauthorizedError(() -> anonymousTester.service().update(new UpdateWsRequest.Builder().setKey(org.getKey()).setName("new name").build())); + expectUnauthorizedError(() -> anonymousTester.service().update(new UpdateRequest.Builder().setKey(org.getKey()).setName("new name").build())); expectUnauthorizedError(() -> anonymousTester.service().delete(org.getKey())); } @@ -174,7 +174,7 @@ public class OrganizationTest { OrganizationTester userTester = tester.as(user.getLogin()).organizations(); expectForbiddenError(() -> userTester.generate()); - expectForbiddenError(() -> userTester.service().update(new UpdateWsRequest.Builder().setKey(org.getKey()).setName("new name").build())); + expectForbiddenError(() -> userTester.service().update(new UpdateRequest.Builder().setKey(org.getKey()).setName("new name").build())); expectForbiddenError(() -> userTester.service().delete(org.getKey())); } @@ -238,9 +238,9 @@ public class OrganizationTest { private void addPermissionsToUser(String orgKeyAndName, String login, String permission, String... otherPermissions) { PermissionsService permissionsService = tester.wsClient().permissions(); - permissionsService.addUser(new AddUserWsRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(permission)); + permissionsService.addUser(new AddUserRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(permission)); for (String otherPermission : otherPermissions) { - permissionsService.addUser(new AddUserWsRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(otherPermission)); + permissionsService.addUser(new AddUserRequest().setLogin(login).setOrganization(orgKeyAndName).setPermission(otherPermission)); } } @@ -294,7 +294,7 @@ public class OrganizationTest { assertThat(organization.getKey()).isNotEmpty(); assertThat(organization.getGuarded()).isFalse(); - List reloadedOrgs = tester.organizations().service().search(SearchWsRequest.builder().build()).getOrganizationsList(); + List reloadedOrgs = tester.organizations().service().search(SearchRequest.builder().build()).getOrganizationsList(); assertThat(reloadedOrgs) .filteredOn(o -> o.getKey().equals(organization.getKey())) .hasSize(1); @@ -302,20 +302,20 @@ public class OrganizationTest { private Components.SearchWsResponse searchSampleProject(String organizationKey, ComponentsService componentsService) { return componentsService - .search(new org.sonarqube.ws.client.component.SearchWsRequest() + .search(new org.sonarqube.ws.client.component.SearchRequest() .setOrganization(organizationKey) .setQualifiers(singletonList("TRK")) .setQuery("sample")); } private void assertThatOrganizationDoesNotExit(Organization org) { - SearchWsRequest request = new SearchWsRequest.Builder().setOrganizations(org.getKey()).build(); + SearchRequest request = new SearchRequest.Builder().setOrganizations(org.getKey()).build(); assertThat(tester.organizations().service().search(request).getOrganizationsList()).isEmpty(); } private void verifyOrganization(Organization createdOrganization, String name, String description, String url, String avatarUrl) { - SearchWsRequest request = new SearchWsRequest.Builder().setOrganizations(createdOrganization.getKey()).build(); + SearchRequest request = new SearchRequest.Builder().setOrganizations(createdOrganization.getKey()).build(); List result = tester.organizations().service().search(request).getOrganizationsList(); assertThat(result).hasSize(1); Organization searchedOrganization = result.get(0); @@ -339,7 +339,7 @@ public class OrganizationTest { } private void assertThatBuiltInQualityProfilesExist(Organization org) { - org.sonarqube.ws.client.qualityprofile.SearchWsRequest profilesRequest = new org.sonarqube.ws.client.qualityprofile.SearchWsRequest() + org.sonarqube.ws.client.qualityprofile.SearchRequest profilesRequest = new org.sonarqube.ws.client.qualityprofile.SearchRequest() .setOrganizationKey(org.getKey()); Qualityprofiles.SearchWsResponse response = tester.wsClient().qualityProfiles().search(profilesRequest); assertThat(response.getProfilesCount()).isGreaterThan(0); @@ -363,6 +363,6 @@ public class OrganizationTest { private void assertThatQualityProfilesDoNotExist(Organization org) { expectNotFoundError(() -> tester.wsClient().qualityProfiles().search( - new org.sonarqube.ws.client.qualityprofile.SearchWsRequest().setOrganizationKey(org.getKey()))); + new org.sonarqube.ws.client.qualityprofile.SearchRequest().setOrganizationKey(org.getKey()))); } } diff --git a/tests/src/test/java/org/sonarqube/tests/organization/PersonalOrganizationTest.java b/tests/src/test/java/org/sonarqube/tests/organization/PersonalOrganizationTest.java index a31f889a890..ac98f4e7d42 100644 --- a/tests/src/test/java/org/sonarqube/tests/organization/PersonalOrganizationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/organization/PersonalOrganizationTest.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Organizations; import org.sonarqube.ws.Users; -import org.sonarqube.ws.client.organization.SearchWsRequest; +import org.sonarqube.ws.client.organization.SearchRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -52,7 +52,7 @@ public class PersonalOrganizationTest { public void personal_organizations_are_created_for_new_users() { Users.CreateWsResponse.User user = tester.users().generate(); - List existing = tester.wsClient().organizations().search(SearchWsRequest.builder().build()).getOrganizationsList(); + List existing = tester.wsClient().organizations().search(SearchRequest.builder().build()).getOrganizationsList(); assertThat(existing) .filteredOn(Organizations.Organization::getGuarded) .filteredOn(o -> o.getKey().equals(user.getLogin())) diff --git a/tests/src/test/java/org/sonarqube/tests/performance/scanner/DuplicationTest.java b/tests/src/test/java/org/sonarqube/tests/performance/scanner/DuplicationTest.java index 6d18fec7152..0ded98c31a3 100644 --- a/tests/src/test/java/org/sonarqube/tests/performance/scanner/DuplicationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/performance/scanner/DuplicationTest.java @@ -37,7 +37,7 @@ import org.sonarqube.ws.Measures; import org.sonarqube.ws.client.HttpConnector; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsClientFactories; -import org.sonarqube.ws.client.measure.ComponentWsRequest; +import org.sonarqube.ws.client.measure.ComponentRequest; import static java.lang.Double.parseDouble; import static java.util.Arrays.asList; @@ -80,7 +80,7 @@ public class DuplicationTest extends AbstractPerfTest { } private Map getMeasures(String key) { - return newWsClient().measures().component(new ComponentWsRequest() + return newWsClient().measures().component(new ComponentRequest() .setComponentKey(key) .setMetricKeys(asList("duplicated_lines", "duplicated_blocks", "duplicated_files", "duplicated_lines_density"))) .getComponent().getMeasuresList() diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectBulkDeletionTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectBulkDeletionTest.java index 7036f46a69d..ce7fdb4bc33 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectBulkDeletionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectBulkDeletionTest.java @@ -30,7 +30,7 @@ import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Organizations; import org.sonarqube.ws.Projects.CreateWsResponse; import org.sonarqube.ws.Projects.SearchWsResponse.Component; -import org.sonarqube.ws.client.project.SearchWsRequest; +import org.sonarqube.ws.client.project.SearchRequest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.runProjectAnalysis; @@ -52,12 +52,12 @@ public class ProjectBulkDeletionTest { analyzeProject(analyzedProject.getKey(), organization.getKey()); - tester.wsClient().projects().bulkDelete(SearchWsRequest.builder() + tester.wsClient().projects().bulkDelete(SearchRequest.builder() .setOrganization(organization.getKey()) .setQuery("FIRST-PROVISIONED") .setOnProvisionedOnly(true).build()); - List projects = tester.wsClient().projects().search(SearchWsRequest.builder().setOrganization(organization.getKey()).build()).getComponentsList(); + List projects = tester.wsClient().projects().search(SearchRequest.builder().setOrganization(organization.getKey()).build()).getComponentsList(); assertThat(projects).extracting(Component::getKey) .containsExactlyInAnyOrder(analyzedProject.getKey(), secondProvisionedProject.getKey()) .doesNotContain(firstProvisionedProject.getKey()); @@ -67,7 +67,7 @@ public class ProjectBulkDeletionTest { public void delete_more_than_50_projects_at_the_same_time() { Organizations.Organization organization = tester.organizations().generate(); IntStream.range(0, 60).forEach(i -> tester.projects().provision(organization)); - SearchWsRequest request = SearchWsRequest.builder().setOrganization(organization.getKey()).build(); + SearchRequest request = SearchRequest.builder().setOrganization(organization.getKey()).build(); assertThat(tester.wsClient().projects().search(request).getPaging().getTotal()).isEqualTo(60); tester.wsClient().projects().bulkDelete(request); diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectDeletionTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectDeletionTest.java index 6495e142727..be1b0b441e6 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectDeletionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectDeletionTest.java @@ -43,7 +43,7 @@ import org.sonarqube.ws.client.WsResponse; import org.sonarqube.ws.client.component.SearchProjectsRequest; import org.sonarqube.ws.client.project.CreateRequest; import org.sonarqube.ws.client.project.DeleteRequest; -import org.sonarqube.ws.client.project.SearchWsRequest; +import org.sonarqube.ws.client.project.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -165,7 +165,7 @@ public class ProjectDeletionTest { } private void bulkDeleteProjects(Organizations.Organization organization, Project... projects) { - SearchWsRequest request = SearchWsRequest.builder() + SearchRequest request = SearchRequest.builder() .setOrganization(organization.getKey()) .setProjects(Arrays.stream(projects).map(Project::getKey).collect(Collectors.toList())) .build(); @@ -194,7 +194,7 @@ public class ProjectDeletionTest { */ private boolean isInProjectsSearch(Organizations.Organization organization, String name) { Projects.SearchWsResponse response = tester.wsClient().projects().search( - SearchWsRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build()); + SearchRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build()); return response.getComponentsCount() > 0; } diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectKeyUpdateTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectKeyUpdateTest.java index b560d54c68f..d209d9154f5 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectKeyUpdateTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectKeyUpdateTest.java @@ -40,10 +40,10 @@ import org.sonarqube.ws.Projects; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; import org.sonarqube.ws.client.component.SearchProjectsRequest; -import org.sonarqube.ws.client.component.ShowWsRequest; -import org.sonarqube.ws.client.project.BulkUpdateKeyWsRequest; +import org.sonarqube.ws.client.component.ShowRequest; +import org.sonarqube.ws.client.project.BulkUpdateKeyRequest; import org.sonarqube.ws.client.project.CreateRequest; -import org.sonarqube.ws.client.project.UpdateKeyWsRequest; +import org.sonarqube.ws.client.project.UpdateKeyRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -71,31 +71,31 @@ public class ProjectKeyUpdateTest { public void update_key() { analyzeXooSample(); String newProjectKey = "another_project_key"; - Components.Component project = tester.wsClient().components().show(new ShowWsRequest().setKey(PROJECT_KEY)).getComponent(); + Components.Component project = tester.wsClient().components().show(new ShowRequest().setKey(PROJECT_KEY)).getComponent(); assertThat(project.getKey()).isEqualTo(PROJECT_KEY); - tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder() + tester.wsClient().projects().updateKey(UpdateKeyRequest.builder() .setKey(PROJECT_KEY) .setNewKey(newProjectKey) .build()); - assertThat(tester.wsClient().components().show(new ShowWsRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey); + assertThat(tester.wsClient().components().show(new ShowRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey); } @Test public void bulk_update_key() { analyzeXooSample(); String newProjectKey = "another_project_key"; - Components.Component project = tester.wsClient().components().show(new ShowWsRequest().setKey(PROJECT_KEY)).getComponent(); + Components.Component project = tester.wsClient().components().show(new ShowRequest().setKey(PROJECT_KEY)).getComponent(); assertThat(project.getKey()).isEqualTo(PROJECT_KEY); - Projects.BulkUpdateKeyWsResponse result = tester.wsClient().projects().bulkUpdateKey(BulkUpdateKeyWsRequest.builder() + Projects.BulkUpdateKeyWsResponse result = tester.wsClient().projects().bulkUpdateKey(BulkUpdateKeyRequest.builder() .setKey(PROJECT_KEY) .setFrom(PROJECT_KEY) .setTo(newProjectKey) .build()); - assertThat(tester.wsClient().components().show(new ShowWsRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey); + assertThat(tester.wsClient().components().show(new ShowRequest().setId(project.getId())).getComponent().getKey()).isEqualTo(newProjectKey); assertThat(result.getKeysCount()).isEqualTo(1); assertThat(result.getKeys(0)) .extracting(Projects.BulkUpdateKeyWsResponse.Key::getKey, Projects.BulkUpdateKeyWsResponse.Key::getNewKey, Projects.BulkUpdateKeyWsResponse.Key::getDuplicate) @@ -229,11 +229,11 @@ public class ProjectKeyUpdateTest { } private void updateKey(Projects.CreateWsResponse.Project project, String newKey) { - tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder().setKey(project.getKey()).setNewKey(newKey).build()); + tester.wsClient().projects().updateKey(UpdateKeyRequest.builder().setKey(project.getKey()).setNewKey(newKey).build()); } private void updateKey(String initialKey, String newKey) { - tester.wsClient().projects().updateKey(UpdateKeyWsRequest.builder().setKey(initialKey).setNewKey(newKey).build()); + tester.wsClient().projects().updateKey(UpdateKeyRequest.builder().setKey(initialKey).setNewKey(newKey).build()); } private Projects.CreateWsResponse.Project createProject(Organizations.Organization organization, String key, String name) { diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectProvisioningTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectProvisioningTest.java index de8a6b65abc..4eb51516718 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectProvisioningTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectProvisioningTest.java @@ -37,7 +37,7 @@ import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; import org.sonarqube.ws.client.component.SearchProjectsRequest; import org.sonarqube.ws.client.project.CreateRequest; -import org.sonarqube.ws.client.project.SearchWsRequest; +import org.sonarqube.ws.client.project.SearchRequest; import util.ItUtils; import static java.util.Collections.singletonList; @@ -101,7 +101,7 @@ public class ProjectProvisioningTest { */ private boolean isInProjectsSearch(Organizations.Organization organization, String name) { Projects.SearchWsResponse response = tester.wsClient().projects().search( - SearchWsRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build()); + SearchRequest.builder().setOrganization(organization.getKey()).setQuery(name).setQualifiers(singletonList("TRK")).build()); return response.getComponentsCount() > 0; } diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectSearchTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectSearchTest.java index 65da3c02981..12508573f70 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectSearchTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectSearchTest.java @@ -32,7 +32,7 @@ import org.sonarqube.ws.Projects.CreateWsResponse; import org.sonarqube.ws.Projects.SearchWsResponse; import org.sonarqube.ws.Projects.SearchWsResponse.Component; import org.sonarqube.ws.client.GetRequest; -import org.sonarqube.ws.client.project.SearchWsRequest; +import org.sonarqube.ws.client.project.SearchRequest; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; @@ -59,7 +59,7 @@ public class ProjectSearchTest { analyzeProject(oldProject.getKey(), moreThanOneYearAgo, organization.getKey()); analyzeProject(recentProject.getKey(), now, organization.getKey()); - SearchWsResponse result = tester.wsClient().projects().search(SearchWsRequest.builder() + SearchWsResponse result = tester.wsClient().projects().search(SearchRequest.builder() .setOrganization(organization.getKey()) .setQualifiers(singletonList("TRK")) .setAnalyzedBefore(formatDate(oneYearAgo)).build()); @@ -78,7 +78,7 @@ public class ProjectSearchTest { analyzeProject(upperCaseProject.getKey(), organization.getKey()); analyzeProject(anotherProject.getKey(), organization.getKey()); - SearchWsResponse result = tester.wsClient().projects().search(SearchWsRequest.builder() + SearchWsResponse result = tester.wsClient().projects().search(SearchRequest.builder() .setOrganization(organization.getKey()) .setQualifiers(singletonList("TRK")) .setQuery("JeCt-K") @@ -101,7 +101,7 @@ public class ProjectSearchTest { String result = tester.wsClient().wsConnector().call(new GetRequest("api/projects/provisioned") .setParam("organization", organization.getKey())) .failIfNotSuccessful().content(); - SearchWsResponse searchResult = tester.wsClient().projects().search(SearchWsRequest.builder() + SearchWsResponse searchResult = tester.wsClient().projects().search(SearchRequest.builder() .setQualifiers(singletonList("TRK")) .setOrganization(organization.getKey()) .setOnProvisionedOnly(true).build()); diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectVisibilityPageTest.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectVisibilityPageTest.java index 92699c3332c..cc7546065c2 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectVisibilityPageTest.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectVisibilityPageTest.java @@ -29,7 +29,7 @@ import org.sonarqube.qa.util.Tester; import org.sonarqube.qa.util.pageobjects.ProjectsManagementPage; import org.sonarqube.ws.Components; import org.sonarqube.ws.client.component.SearchProjectsRequest; -import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; +import org.sonarqube.ws.client.permission.RemoveGroupRequest; import org.sonarqube.ws.client.project.UpdateVisibilityRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -57,7 +57,7 @@ public class ProjectVisibilityPageTest { orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")).setProperties("sonar.projectKey", "sample2")); tester.wsClient().projects().updateVisibility(UpdateVisibilityRequest.builder().setProject("sample2").setVisibility("private").build()); // Remove 'Admin' permission for admin group on project 2 -> No one can access or admin this project, expect System Admin - tester.wsClient().permissions().removeGroup(new RemoveGroupWsRequest().setProjectKey("sample2").setGroupName("sonar-administrators").setPermission("admin")); + tester.wsClient().permissions().removeGroup(new RemoveGroupRequest().setProjectKey("sample2").setGroupName("sonar-administrators").setPermission("admin")); tester.openBrowser().logIn().submitCredentials(adminUser) .openProjectsManagement("default-organization") diff --git a/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateUiTest.java b/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateUiTest.java index 507410d6b6b..d311e4aab1b 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateUiTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateUiTest.java @@ -32,6 +32,7 @@ import org.sonarqube.qa.util.pageobjects.ProjectDashboardPage; import org.sonarqube.qa.util.pageobjects.QualityGatePage; import org.sonarqube.ws.Organizations; import org.sonarqube.ws.Users; +import org.sonarqube.ws.client.permission.AddUserRequest; import util.issue.IssueRule; import static com.codeborne.selenide.Selenide.$; @@ -58,7 +59,7 @@ public class OrganizationQualityGateUiTest { organization = tester.organizations().generate(); gateAdmin = tester.users().generate(); tester.organizations().addMember(tester.organizations().getDefaultOrganization(), gateAdmin); - tester.wsClient().permissions().addUser(new org.sonarqube.ws.client.permission.AddUserWsRequest().setLogin(gateAdmin.getLogin()).setPermission("gateadmin")); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(gateAdmin.getLogin()).setPermission("gateadmin")); user = tester.users().generate(); tester.organizations().addMember(organization, user); restoreProfile(orchestrator, getClass().getResource("/issue/with-many-rules.xml"), organization.getKey()); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java index 12be1f95854..51439df8ea9 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java @@ -54,7 +54,7 @@ import org.sonarqube.ws.Users; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.qualitygates.CreateConditionRequest; import org.sonarqube.ws.client.qualitygates.CreateRequest; import org.sonarqube.ws.client.qualitygates.ProjectStatusRequest; @@ -293,7 +293,7 @@ public class QualityGateTest { // user is quality gate admin of default organization Organization organization = tester.organizations().getDefaultOrganization(); Users.CreateWsResponse.User user = tester.users().generateMember(organization); - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("gateadmin").setOrganization(organization.getKey())); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(user.getLogin()).setPermission("gateadmin").setOrganization(organization.getKey())); TesterSession qGateAdminTester = tester.as(user.getLogin()); QualitygatesService qGateService = qGateAdminTester.qGates().service(); // perform administration operations diff --git a/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtInIssueChangelogTest.java b/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtInIssueChangelogTest.java index 0bf2f9db32b..6e2ef0c0674 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtInIssueChangelogTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtInIssueChangelogTest.java @@ -27,7 +27,7 @@ import org.junit.Rule; import org.junit.Test; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Issues; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -58,7 +58,7 @@ public class TechnicalDebtInIssueChangelogTest { orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")) .setProperties("sonar.oneIssuePerFile.effortToFix", "10")); - Issues.Issue firstIssue = tester.wsClient().issues().search(new SearchWsRequest()).getIssues(0); + Issues.Issue firstIssue = tester.wsClient().issues().search(new SearchRequest()).getIssues(0); List changes = changelog(firstIssue.getKey()).getChangelogList(); assertThat(changes).hasSize(1); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtTest.java b/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtTest.java index 5ce1e174a44..24d60d3b88a 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityModel/TechnicalDebtTest.java @@ -27,7 +27,7 @@ import org.junit.Rule; import org.junit.Test; import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.Issues; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -54,7 +54,7 @@ public class TechnicalDebtTest { orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample"))); // All the issues should have a technical debt - List issues = tester.wsClient().issues().search(new SearchWsRequest()).getIssuesList(); + List issues = tester.wsClient().issues().search(new SearchRequest()).getIssuesList(); assertThat(issues).isNotEmpty(); for (Issues.Issue issue : issues) { assertThat(issue.getDebt()).isEqualTo("1min"); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java index 3922d96b29c..ef08e8e8317 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java @@ -31,8 +31,8 @@ import org.junit.Test; import org.sonarqube.ws.Users; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.permission.AddGroupWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddGroupRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest; import org.sonarqube.ws.client.qualityprofile.CreateRequest; import org.subethamail.wiser.Wiser; @@ -77,7 +77,7 @@ public class BuiltInQualityProfilesNotificationTest { userRule = UserRule.from(orchestrator); Users.CreateWsResponse.User profileAdmin1 = userRule.generate(); WsClient wsClient = ItUtils.newAdminWsClient(orchestrator); - wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); + wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); orchestrator.restartServer(); @@ -100,12 +100,12 @@ public class BuiltInQualityProfilesNotificationTest { // Create a quality profile administrator (user having direct permission) Users.CreateWsResponse.User profileAdmin1 = userRule.generate(); WsClient wsClient = ItUtils.newAdminWsClient(orchestrator); - wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); + wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); // Create a quality profile administrator (user having permission from a group) Users.CreateWsResponse.User profileAdmin2 = userRule.generate(); String groupName = randomAlphanumeric(20); wsClient.wsConnector().call(new PostRequest("api/user_groups/create").setParam("name", groupName)).failIfNotSuccessful(); - wsClient.permissions().addGroup(new AddGroupWsRequest().setPermission("profileadmin").setGroupName(groupName)); + wsClient.permissions().addGroup(new AddGroupRequest().setPermission("profileadmin").setGroupName(groupName)); wsClient.wsConnector().call(new PostRequest("api/user_groups/add_user").setParam("name", groupName).setParam("login", profileAdmin2.getLogin())).failIfNotSuccessful(); // Create a user not being quality profile administrator Users.CreateWsResponse.User noProfileAdmin = userRule.generate(); @@ -156,7 +156,7 @@ public class BuiltInQualityProfilesNotificationTest { userRule = UserRule.from(orchestrator); Users.CreateWsResponse.User profileAdmin1 = userRule.generate(); WsClient wsClient = ItUtils.newAdminWsClient(orchestrator); - wsClient.permissions().addUser(new AddUserWsRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); + wsClient.permissions().addUser(new AddUserRequest().setLogin(profileAdmin1.getLogin()).setPermission("profileadmin")); // uninstall plugin V1 wsClient.wsConnector().call(new PostRequest("api/plugins/uninstall").setParam("key", "foo")).failIfNotSuccessful(); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesTest.java index 2ace14e222a..be5eb2a3ee9 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesTest.java @@ -36,7 +36,7 @@ import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest; import org.sonarqube.ws.client.qualityprofile.CopyRequest; import org.sonarqube.ws.client.qualityprofile.QualityProfilesService; -import org.sonarqube.ws.client.qualityprofile.SearchWsRequest; +import org.sonarqube.ws.client.qualityprofile.SearchRequest; import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -55,7 +55,7 @@ public class BuiltInQualityProfilesTest { @Test public void built_in_profiles_are_available_in_new_organization() { Organization org = tester.organizations().generate(); - SearchWsResponse result = tester.qProfiles().service().search(new SearchWsRequest().setOrganizationKey(org.getKey())); + SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey(org.getKey())); assertThat(result.getProfilesList()) .extracting(QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault) @@ -70,7 +70,7 @@ public class BuiltInQualityProfilesTest { @Test public void built_in_profiles_are_available_in_default_organization() { - SearchWsResponse result = tester.qProfiles().service().search(new SearchWsRequest().setOrganizationKey("default-organization")); + SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey("default-organization")); assertThat(result.getProfilesList()) .extracting(QualityProfile::getOrganization, QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault) @@ -154,7 +154,7 @@ public class BuiltInQualityProfilesTest { } private QualityProfile getProfile(Organization organization, Predicate filter) { - return tester.qProfiles().service().search(new SearchWsRequest() + return tester.qProfiles().service().search(new SearchRequest() .setOrganizationKey(organization.getKey())).getProfilesList() .stream() .filter(filter) diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/CustomQualityProfilesTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/CustomQualityProfilesTest.java index fe00a8d4472..ef5199d1b64 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/CustomQualityProfilesTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/CustomQualityProfilesTest.java @@ -41,7 +41,7 @@ import org.sonarqube.ws.client.qualityprofile.AddProjectRequest; import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest; import org.sonarqube.ws.client.qualityprofile.CopyRequest; import org.sonarqube.ws.client.qualityprofile.CreateRequest; -import org.sonarqube.ws.client.qualityprofile.SearchWsRequest; +import org.sonarqube.ws.client.qualityprofile.SearchRequest; import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest; import util.ItUtils; @@ -154,10 +154,10 @@ public class CustomQualityProfilesTest { tester.organizations().service().delete(org.getKey()); - expectMissingError(() -> tester.qProfiles().service().search(new SearchWsRequest() + expectMissingError(() -> tester.qProfiles().service().search(new SearchRequest() .setOrganizationKey(org.getKey()))); - tester.qProfiles().service().search(new SearchWsRequest()).getProfilesList() + tester.qProfiles().service().search(new SearchRequest()).getProfilesList() .forEach(p -> { assertThat(p.getOrganization()).isNotEqualTo(org.getKey()); assertThat(p.getKey()).isNotIn(parentProfile.getKey(), copyResponse.getKey(), inheritedProfile1.getKey(), inheritedProfile2.getKey()); @@ -319,7 +319,7 @@ public class CustomQualityProfilesTest { } private Qualityprofiles.SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate filter) { - return tester.qProfiles().service().search(new SearchWsRequest() + return tester.qProfiles().service().search(new SearchRequest() .setOrganizationKey(organization.getKey())).getProfilesList() .stream() .filter(filter) diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java index b6e884eaa77..6b6ed149993 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java @@ -35,14 +35,13 @@ import org.sonarqube.ws.Qualityprofiles.SearchWsResponse; import org.sonarqube.ws.UserGroups; import org.sonarqube.ws.Users.CreateWsResponse.User; import org.sonarqube.ws.client.PostRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.qualityprofile.AddGroupRequest; -import org.sonarqube.ws.client.qualityprofile.AddUserRequest; import org.sonarqube.ws.client.qualityprofile.RemoveGroupRequest; import org.sonarqube.ws.client.qualityprofile.RemoveUserRequest; import org.sonarqube.ws.client.qualityprofile.SearchGroupsRequest; import org.sonarqube.ws.client.qualityprofile.SearchUsersRequest; -import org.sonarqube.ws.client.qualityprofile.SearchWsRequest; +import org.sonarqube.ws.client.qualityprofile.SearchRequest; import org.sonarqube.ws.client.qualityprofile.ShowRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -211,7 +210,7 @@ public class QualityProfilesEditTest { CreateWsResponse.QualityProfile xooProfile3 = tester.qProfiles().createXooProfile(organization); SearchWsResponse result = tester.as(user.getLogin()) - .qProfiles().service().search(new SearchWsRequest().setOrganizationKey(organization.getKey())); + .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey())); assertThat(result.getActions().getCreate()).isFalse(); assertThat(result.getProfilesList()) .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault()) @@ -226,10 +225,10 @@ public class QualityProfilesEditTest { Organization organization = tester.organizations().generate(); User user = tester.users().generateMember(organization); CreateWsResponse.QualityProfile xooProfile = tester.qProfiles().createXooProfile(organization); - tester.wsClient().permissions().addUser(new AddUserWsRequest().setOrganization(organization.getKey()).setLogin(user.getLogin()).setPermission("profileadmin")); + tester.wsClient().permissions().addUser(new AddUserRequest().setOrganization(organization.getKey()).setLogin(user.getLogin()).setPermission("profileadmin")); SearchWsResponse result = tester.as(user.getLogin()) - .qProfiles().service().search(new SearchWsRequest().setOrganizationKey(organization.getKey())); + .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey())); assertThat(result.getActions().getCreate()).isTrue(); assertThat(result.getProfilesList()) .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault()) @@ -267,7 +266,7 @@ public class QualityProfilesEditTest { } private void addUserPermission(Organization organization, User user, CreateWsResponse.QualityProfile qProfile) { - tester.qProfiles().service().addUser(AddUserRequest.builder() + tester.qProfiles().service().addUser(org.sonarqube.ws.client.qualityprofile.AddUserRequest.builder() .setOrganization(organization.getKey()) .setQualityProfile(qProfile.getName()) .setLanguage(qProfile.getLanguage()) @@ -285,7 +284,7 @@ public class QualityProfilesEditTest { } private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate filter) { - return tester.qProfiles().service().search(new SearchWsRequest() + return tester.qProfiles().service().search(new SearchRequest() .setOrganizationKey(organization.getKey())).getProfilesList() .stream() .filter(filter) diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesWsTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesWsTest.java index 21b319f6f78..f7837897556 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesWsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesWsTest.java @@ -38,8 +38,8 @@ import org.sonarqube.ws.Qualityprofiles.ShowResponse.QualityProfile; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.qualityprofile.ChangelogWsRequest; -import org.sonarqube.ws.client.qualityprofile.SearchWsRequest; +import org.sonarqube.ws.client.qualityprofile.ChangelogRequest; +import org.sonarqube.ws.client.qualityprofile.SearchRequest; import org.sonarqube.ws.client.qualityprofile.ShowRequest; import static org.assertj.core.api.Assertions.assertThat; @@ -133,7 +133,7 @@ public class QualityProfilesWsTest { Organization org = tester.organizations().generate(); CreateWsResponse.QualityProfile profile = tester.qProfiles().createXooProfile(org); - String changelog = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder() + String changelog = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder() .setOrganization(org.getKey()) .setLanguage(profile.getLanguage()) .setQualityProfile(profile.getName()) @@ -143,14 +143,14 @@ public class QualityProfilesWsTest { tester.qProfiles().activateRule(profile, RULE_ONE_BUG_PER_LINE); tester.qProfiles().activateRule(profile, RULE_ONE_ISSUE_PER_LINE); - String changelog2 = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder() + String changelog2 = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder() .setOrganization(org.getKey()) .setLanguage(profile.getLanguage()) .setQualityProfile(profile.getName()) .build()); JSONAssert.assertEquals(EXPECTED_CHANGELOG, changelog2, JSONCompareMode.LENIENT); - String changelog3 = tester.wsClient().qualityProfiles().changelog(ChangelogWsRequest.builder() + String changelog3 = tester.wsClient().qualityProfiles().changelog(ChangelogRequest.builder() .setOrganization(org.getKey()) .setLanguage(profile.getLanguage()) .setQualityProfile(profile.getName()) @@ -160,7 +160,7 @@ public class QualityProfilesWsTest { } private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate filter) { - return tester.qProfiles().service().search(new SearchWsRequest() + return tester.qProfiles().service().search(new SearchRequest() .setOrganizationKey(organization.getKey())).getProfilesList() .stream() .filter(filter) diff --git a/tests/src/test/java/org/sonarqube/tests/rule/RulesWsTest.java b/tests/src/test/java/org/sonarqube/tests/rule/RulesWsTest.java index f2249a9b6a8..31cef84c190 100644 --- a/tests/src/test/java/org/sonarqube/tests/rule/RulesWsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/rule/RulesWsTest.java @@ -83,7 +83,7 @@ public class RulesWsTest { } private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate filter) { - return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofile.SearchWsRequest() + return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofile.SearchRequest() .setOrganizationKey(organization.getKey())).getProfilesList() .stream() .filter(filter) diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/LogsTest.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/LogsTest.java index e9eb13360e9..d312aa09a3c 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/LogsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/LogsTest.java @@ -36,7 +36,7 @@ import org.junit.ClassRule; import org.junit.Test; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import util.ItUtils; import static java.lang.String.format; @@ -116,7 +116,7 @@ public class LogsTest { private void generateSqlAndEsLogsInWebAndCe() { orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample"))); - ItUtils.newAdminWsClient(orchestrator).issues().search(new SearchWsRequest() + ItUtils.newAdminWsClient(orchestrator).issues().search(new SearchRequest() .setProjectKeys(Collections.singletonList("sample"))); } diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java index e1219ae9ee6..17bf6776746 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java @@ -32,7 +32,7 @@ import org.junit.rules.Timeout; import org.sonarqube.ws.System; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -97,7 +97,7 @@ public class RestartTest { private void createSystemAdministrator(String login, String password) { WsClient wsClient = newAdminWsClient(orchestrator); createNonSystemAdministrator(wsClient, login, password); - wsClient.permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission("admin")); + wsClient.permissions().addUser(new AddUserRequest().setLogin(login).setPermission("admin")); } private void createNonSystemAdministrator(String login, String password) { diff --git a/tests/src/test/java/org/sonarqube/tests/settings/SettingsTest.java b/tests/src/test/java/org/sonarqube/tests/settings/SettingsTest.java index 9733ff6bb47..35741444b28 100644 --- a/tests/src/test/java/org/sonarqube/tests/settings/SettingsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/settings/SettingsTest.java @@ -35,9 +35,9 @@ import org.junit.rules.RuleChain; import org.sonarqube.tests.Category1Suite; import org.sonarqube.ws.Settings; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.permission.AddGroupWsRequest; -import org.sonarqube.ws.client.permission.AddUserWsRequest; -import org.sonarqube.ws.client.permission.RemoveGroupWsRequest; +import org.sonarqube.ws.client.permission.AddGroupRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; +import org.sonarqube.ws.client.permission.RemoveGroupRequest; import org.sonarqube.ws.client.settings.ResetRequest; import org.sonarqube.ws.client.settings.SetRequest; import org.sonarqube.ws.client.settings.SettingsService; @@ -81,7 +81,7 @@ public class SettingsTest { userRule.createUser("scanner-user", "scanner-user"); adminWsClient = newAdminWsClient(orchestrator); // Remove 'Execute Analysis' permission from anyone - adminWsClient.permissions().removeGroup(new RemoveGroupWsRequest().setGroupName("anyone").setPermission("scan")); + adminWsClient.permissions().removeGroup(new RemoveGroupRequest().setGroupName("anyone").setPermission("scan")); // Anonymous user, without 'Execute Analysis' permission anonymousSettingsService = newWsClient(orchestrator).settings(); @@ -90,7 +90,7 @@ public class SettingsTest { userSettingsService = newUserWsClient(orchestrator, "setting-user", "setting-user").settings(); // User with 'Execute Analysis' permission - adminWsClient.permissions().addUser(new AddUserWsRequest().setLogin("scanner-user").setPermission("scan")); + adminWsClient.permissions().addUser(new AddUserRequest().setLogin("scanner-user").setPermission("scan")); scanSettingsService = newUserWsClient(orchestrator, "scanner-user", "scanner-user").settings(); // User with 'Administer System' permission but without 'Execute Analysis' permission @@ -101,7 +101,7 @@ public class SettingsTest { public static void tearDown() throws Exception { userRule.deactivateUsers("setting-user", "scanner-user"); // Restore 'Execute Analysis' permission to anyone - adminWsClient.permissions().addGroup(new AddGroupWsRequest().setGroupName("anyone").setPermission("scan")); + adminWsClient.permissions().addGroup(new AddGroupRequest().setGroupName("anyone").setPermission("scan")); } @After diff --git a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java index 607ef2d4615..9f5f1a87b9f 100644 --- a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java +++ b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java @@ -42,7 +42,7 @@ import org.sonarqube.ws.client.HttpConnector; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsClientFactories; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.measure.ComponentWsRequest; +import org.sonarqube.ws.client.measure.ComponentRequest; import static com.codeborne.selenide.Condition.hasText; import static com.codeborne.selenide.Selenide.$; @@ -198,7 +198,7 @@ public class UpgradeTest { } private int countFiles(String key) { - Measure measure = newWsClient(orchestrator).measures().component(new ComponentWsRequest().setComponentKey(key).setMetricKeys(Collections.singletonList("files"))) + Measure measure = newWsClient(orchestrator).measures().component(new ComponentRequest().setComponentKey(key).setMetricKeys(Collections.singletonList("files"))) .getComponent().getMeasures(0); return parseInt(measure.getValue()); } diff --git a/tests/src/test/java/org/sonarqube/tests/user/OAuth2IdentityProviderTest.java b/tests/src/test/java/org/sonarqube/tests/user/OAuth2IdentityProviderTest.java index 2f6e7f36f1b..7e9a294fc49 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/OAuth2IdentityProviderTest.java +++ b/tests/src/test/java/org/sonarqube/tests/user/OAuth2IdentityProviderTest.java @@ -38,7 +38,7 @@ import org.sonarqube.tests.Category4Suite; import org.sonarqube.ws.Users.SearchWsResponse.User; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.user.CreateRequest; import util.selenium.Selenese; @@ -125,7 +125,7 @@ public class OAuth2IdentityProviderTest { enablePlugin(); tester.users().generate(u -> u.setLogin(USER_LOGIN)); // Give user global admin permission as we want to go to a page where authentication is required - tester.wsClient().permissions().addUser(new AddUserWsRequest().setLogin(USER_LOGIN).setPermission("admin")); + tester.wsClient().permissions().addUser(new AddUserRequest().setLogin(USER_LOGIN).setPermission("admin")); Navigation nav = tester.openBrowser(); // Try to go to the settings page diff --git a/tests/src/test/java/util/ItUtils.java b/tests/src/test/java/util/ItUtils.java index 5f8a5a4b76b..7a9fbafcd54 100644 --- a/tests/src/test/java/util/ItUtils.java +++ b/tests/src/test/java/util/ItUtils.java @@ -70,9 +70,9 @@ import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.HttpConnector; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsClientFactories; -import org.sonarqube.ws.client.component.ShowWsRequest; -import org.sonarqube.ws.client.measure.ComponentWsRequest; -import org.sonarqube.ws.client.qualityprofile.RestoreWsRequest; +import org.sonarqube.ws.client.component.ShowRequest; +import org.sonarqube.ws.client.measure.ComponentRequest; +import org.sonarqube.ws.client.qualityprofile.RestoreRequest; import org.sonarqube.ws.client.settings.ResetRequest; import org.sonarqube.ws.client.settings.SetRequest; @@ -334,7 +334,7 @@ public class ItUtils { } private static Stream getStreamMeasures(Orchestrator orchestrator, String componentKey, String... metricKeys) { - return newWsClient(orchestrator).measures().component(new ComponentWsRequest() + return newWsClient(orchestrator).measures().component(new ComponentRequest() .setComponent(componentKey) .setMetricKeys(asList(metricKeys))) .getComponent().getMeasuresList() @@ -343,7 +343,7 @@ public class ItUtils { @CheckForNull public static Measure getMeasureWithVariation(Orchestrator orchestrator, String componentKey, String metricKey) { - Measures.ComponentWsResponse response = newWsClient(orchestrator).measures().component(new ComponentWsRequest() + Measures.ComponentWsResponse response = newWsClient(orchestrator).measures().component(new ComponentRequest() .setComponentKey(componentKey) .setMetricKeys(singletonList(metricKey)) .setAdditionalFields(singletonList("periods"))); @@ -353,7 +353,7 @@ public class ItUtils { @CheckForNull public static Map getMeasuresWithVariationsByMetricKey(Orchestrator orchestrator, String componentKey, String... metricKeys) { - return newWsClient(orchestrator).measures().component(new ComponentWsRequest() + return newWsClient(orchestrator).measures().component(new ComponentRequest() .setComponentKey(componentKey) .setMetricKeys(asList(metricKeys)) .setAdditionalFields(singletonList("periods"))).getComponent().getMeasuresList() @@ -373,7 +373,7 @@ public class ItUtils { @CheckForNull public static Component getComponent(Orchestrator orchestrator, String componentKey) { try { - return newWsClient(orchestrator).components().show(new ShowWsRequest().setKey((componentKey))).getComponent(); + return newWsClient(orchestrator).components().show(new ShowRequest().setKey((componentKey))).getComponent(); } catch (org.sonarqube.ws.client.HttpException e) { if (e.code() == 404) { return null; @@ -405,7 +405,7 @@ public class ItUtils { newAdminWsClient(orchestrator) .qualityProfiles() .restoreProfile( - RestoreWsRequest.builder() + RestoreRequest.builder() .setBackup(new File(uri)) .setOrganization(organization) .build()); diff --git a/tests/src/test/java/util/issue/IssueRule.java b/tests/src/test/java/util/issue/IssueRule.java index 7857d3cabdc..c055a2b4385 100644 --- a/tests/src/test/java/util/issue/IssueRule.java +++ b/tests/src/test/java/util/issue/IssueRule.java @@ -25,7 +25,7 @@ import org.junit.rules.ExternalResource; import org.sonarqube.ws.Issues.Issue; import org.sonarqube.ws.Issues.SearchWsResponse; import org.sonarqube.ws.client.WsClient; -import org.sonarqube.ws.client.issue.SearchWsRequest; +import org.sonarqube.ws.client.issue.SearchRequest; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -47,24 +47,24 @@ public class IssueRule extends ExternalResource { return new IssueRule(requireNonNull(orchestrator, "Orchestrator instance can not be null")); } - public SearchWsResponse search(SearchWsRequest request) { + public SearchWsResponse search(SearchRequest request) { return adminWsClient().issues().search(request); } public Issue getRandomIssue() { - List issues = search(new SearchWsRequest()).getIssuesList(); + List issues = search(new SearchRequest()).getIssuesList(); assertThat(issues).isNotEmpty(); return issues.get(0); } public Issue getByKey(String issueKey) { - List issues = search(new SearchWsRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("_all"))).getIssuesList(); + List issues = search(new SearchRequest().setIssues(singletonList(issueKey)).setAdditionalFields(singletonList("_all"))).getIssuesList(); assertThat(issues).hasSize(1); return issues.iterator().next(); } public List getByKeys(String... issueKeys) { - List issues = search(new SearchWsRequest().setIssues(asList(issueKeys)).setAdditionalFields(singletonList("_all"))).getIssuesList(); + List issues = search(new SearchRequest().setIssues(asList(issueKeys)).setAdditionalFields(singletonList("_all"))).getIssuesList(); assertThat(issues).hasSize(issueKeys.length); return issues; } diff --git a/tests/src/test/java/util/user/UserRule.java b/tests/src/test/java/util/user/UserRule.java index 9e8cc191020..9c2db03e6e7 100644 --- a/tests/src/test/java/util/user/UserRule.java +++ b/tests/src/test/java/util/user/UserRule.java @@ -35,12 +35,11 @@ import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; import org.sonarqube.ws.client.WsResponse; -import org.sonarqube.ws.client.permission.AddUserWsRequest; +import org.sonarqube.ws.client.permission.AddUserRequest; import org.sonarqube.ws.client.roots.SetRootRequest; import org.sonarqube.ws.client.user.CreateRequest; import org.sonarqube.ws.client.user.SearchRequest; import org.sonarqube.ws.client.user.UsersService; -import org.sonarqube.ws.client.usergroups.AddUserRequest; import util.selenium.Consumer; import static java.util.Arrays.asList; @@ -148,8 +147,8 @@ public class UserRule extends ExternalResource implements GroupManagement { public String createAdminUser(String login, String password) { createUser(login, password); - adminWsClient.permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission("admin")); - adminWsClient.userGroups().addUser(new AddUserRequest().setLogin(login).setName("sonar-administrators")); + adminWsClient.permissions().addUser(new AddUserRequest().setLogin(login).setPermission("admin")); + adminWsClient.userGroups().addUser(new org.sonarqube.ws.client.usergroups.AddUserRequest().setLogin(login).setName("sonar-administrators")); return login; } -- 2.39.5