diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2023-05-26 11:12:30 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-05-26 20:03:09 +0000 |
commit | b7f90fc1c4d20d202fd244b3db791884c6a37293 (patch) | |
tree | acf5a87a87a8a4defce440e5241772b45bd7582e /sonar-ws/src | |
parent | 53c9f82d5ed08178ef731d08e6a650878dfbbfeb (diff) | |
download | sonarqube-b7f90fc1c4d20d202fd244b3db791884c6a37293.tar.gz sonarqube-b7f90fc1c4d20d202fd244b3db791884c6a37293.zip |
SONAR-19314 Add ITs for GitHub Enterprise provisioning
Diffstat (limited to 'sonar-ws/src')
3 files changed, 53 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java index fc9df74e81f..50f5384554e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java @@ -34,6 +34,7 @@ import org.sonarqube.ws.client.duplications.DuplicationsService; import org.sonarqube.ws.client.editions.EditionsService; import org.sonarqube.ws.client.emails.EmailsService; import org.sonarqube.ws.client.favorites.FavoritesService; +import org.sonarqube.ws.client.githubprovisioning.GithubProvisioningService; import org.sonarqube.ws.client.governancereports.GovernanceReportsService; import org.sonarqube.ws.client.hotspots.HotspotsService; import org.sonarqube.ws.client.issues.IssuesService; @@ -140,6 +141,7 @@ class DefaultWsClient implements WsClient { private final SecurityReportsService securityReportsService; private final RegulatoryReportsService regulatoryReportsService; private final SonarLintServerPushService sonarLintPushService; + private final GithubProvisioningService githubProvisioningService; DefaultWsClient(WsConnector wsConnector) { this.wsConnector = wsConnector; @@ -198,6 +200,7 @@ class DefaultWsClient implements WsClient { this.securityReportsService = new SecurityReportsService(wsConnector); this.sonarLintPushService = new SonarLintServerPushService(wsConnector); this.regulatoryReportsService = new RegulatoryReportsService(wsConnector); + this.githubProvisioningService = new GithubProvisioningService(wsConnector); } @Override @@ -417,6 +420,11 @@ class DefaultWsClient implements WsClient { } @Override + public GithubProvisioningService githubProvisioning() { + return githubProvisioningService; + } + + @Override public SourcesService sources() { return sourcesService; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java index 7ea98457bfa..d7ed0b38ad1 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java @@ -34,6 +34,7 @@ import org.sonarqube.ws.client.duplications.DuplicationsService; import org.sonarqube.ws.client.editions.EditionsService; import org.sonarqube.ws.client.emails.EmailsService; import org.sonarqube.ws.client.favorites.FavoritesService; +import org.sonarqube.ws.client.githubprovisioning.GithubProvisioningService; import org.sonarqube.ws.client.governancereports.GovernanceReportsService; import org.sonarqube.ws.client.hotspots.HotspotsService; import org.sonarqube.ws.client.issues.IssuesService; @@ -176,6 +177,8 @@ public interface WsClient { SettingsService settings(); + GithubProvisioningService githubProvisioning(); + SourcesService sources(); SupportService support(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/githubprovisioning/GithubProvisioningService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/githubprovisioning/GithubProvisioningService.java new file mode 100644 index 00000000000..e172e153b97 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/githubprovisioning/GithubProvisioningService.java @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonarqube.ws.client.githubprovisioning; + +import org.sonarqube.ws.client.BaseService; +import org.sonarqube.ws.client.PostRequest; +import org.sonarqube.ws.client.WsConnector; + +public class GithubProvisioningService extends BaseService { + public GithubProvisioningService(WsConnector wsConnector) { + super(wsConnector, "api/github_provisioning"); + } + + public void enable() { + call( + new PostRequest(path("enable")) + ); + } + + public void disable() { + call( + new PostRequest(path("disable")) + ); + } +} |