]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16316 Add IT
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Tue, 31 May 2022 17:13:10 +0000 (12:13 -0500)
committersonartech <sonartech@sonarsource.com>
Wed, 1 Jun 2022 20:03:02 +0000 (20:03 +0000)
sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java [new file with mode: 0644]
sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/RegulatoryReportsService.java [new file with mode: 0644]
sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java [new file with mode: 0644]

index bdbd30cb92ae6304301de6a19ffea1ae8e7e5521..9b7b205059c776396a346f51b4647fdbb7ea87d4 100644 (file)
@@ -58,6 +58,7 @@ import org.sonarqube.ws.client.properties.PropertiesService;
 import org.sonarqube.ws.client.push.SonarLintServerPushService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
+import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
 import org.sonarqube.ws.client.securityreports.SecurityReportsService;
@@ -139,6 +140,7 @@ class DefaultWsClient implements WsClient {
   private final WebservicesService webservicesService;
   private final BatchService batchService;
   private final SecurityReportsService securityReportsService;
+  private final RegulatoryReportsService regulatoryReportsService;
   private final SonarLintServerPushService sonarLintPushService;
 
   DefaultWsClient(WsConnector wsConnector) {
@@ -198,6 +200,7 @@ class DefaultWsClient implements WsClient {
     this.batchService = new BatchService(wsConnector);
     this.securityReportsService = new SecurityReportsService(wsConnector);
     this.sonarLintPushService = new SonarLintServerPushService(wsConnector);
+    this.regulatoryReportsService = new RegulatoryReportsService(wsConnector);
   }
 
   @Override
@@ -246,6 +249,11 @@ class DefaultWsClient implements WsClient {
     return developersService;
   }
 
+  @Override
+  public RegulatoryReportsService regulatoryReports() {
+    return regulatoryReportsService;
+  }
+  
   @Override
   public DuplicationsService duplications() {
     return duplicationsService;
index f616d7574ed81a32f9d578284f8a5048c83d65f2..c70da8022ae60777f067449df713e4f9ac2fbd20 100644 (file)
@@ -58,6 +58,7 @@ import org.sonarqube.ws.client.properties.PropertiesService;
 import org.sonarqube.ws.client.push.SonarLintServerPushService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
+import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
 import org.sonarqube.ws.client.securityreports.SecurityReportsService;
@@ -202,6 +203,8 @@ public interface WsClient {
 
   SecurityReportsService securityReports();
 
+  RegulatoryReportsService regulatoryReports();
+
   MonitoringService monitoring();
 
   SonarLintServerPushService sonarLintPush();
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java
new file mode 100644 (file)
index 0000000..c5c597d
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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.regulatoryreports;
+
+import java.util.List;
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/regulatory_reports/download">Further information about this action online (including a response example)</a>
+ * @since 9.5
+ */
+@Generated("sonar-ws-generator")
+public class DownloadRequest {
+
+  private String branch;
+  private String project;
+
+  /**
+   * Example value: "feature/my_branch"
+   */
+  public DownloadRequest setBranch(String branch) {
+    this.branch = branch;
+    return this;
+  }
+
+  public String getBranch() {
+    return branch;
+  }
+
+  /**
+   * This is a mandatory parameter.
+   * Example value: "my_project"
+   */
+  public DownloadRequest setProject(String project) {
+    this.project = project;
+    return this;
+  }
+
+  public String getProject() {
+    return project;
+  }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/RegulatoryReportsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/RegulatoryReportsService.java
new file mode 100644 (file)
index 0000000..360e7be
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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.regulatoryreports;
+
+import java.io.InputStream;
+import javax.annotation.Generated;
+import org.sonarqube.ws.MediaTypes;
+import org.sonarqube.ws.client.BaseService;
+import org.sonarqube.ws.client.GetRequest;
+import org.sonarqube.ws.client.WsConnector;
+
+/**
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/regulatory_reports">Further information about this web service online</a>
+ */
+@Generated("sonar-ws-generator")
+public class RegulatoryReportsService extends BaseService {
+
+  public RegulatoryReportsService(WsConnector wsConnector) {
+    super(wsConnector, "api/regulatory_reports");
+  }
+
+  /**
+   *
+   * This is part of the internal API.
+   * This is a GET request.
+   * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/regulatory_reports/download">Further information about this action online (including a response example)</a>
+   * @since 9.5
+   */
+  public InputStream download(DownloadRequest request) {
+    return call(
+      new GetRequest(path("download"))
+        .setParam("branch", request.getBranch())
+        .setParam("project", request.getProject())
+        .setMediaType(MediaTypes.JSON)
+      ).contentStream();
+  }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java
new file mode 100644 (file)
index 0000000..5e9ab65
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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.
+ */
+@ParametersAreNonnullByDefault
+@Generated("sonar-ws-generator")
+package org.sonarqube.ws.client.regulatoryreports;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+import javax.annotation.Generated;
+