diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-10-17 17:33:18 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-10-25 20:21:01 +0200 |
commit | 6cdca36b0a63d8819ba1a35d74633a489e9abbbc (patch) | |
tree | 33be382825aa188be9bb77d4764e21d17048aac6 /sonar-ws/src/main/java/org/sonarqube | |
parent | e14f55a7bb0ca1bfcc8d2a584146c54964ef0952 (diff) | |
download | sonarqube-6cdca36b0a63d8819ba1a35d74633a489e9abbbc.tar.gz sonarqube-6cdca36b0a63d8819ba1a35d74633a489e9abbbc.zip |
SONAR-11370 Add ITs to verify security reports content
Diffstat (limited to 'sonar-ws/src/main/java/org/sonarqube')
5 files changed, 188 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 b7406f4af0b..469b707ee5f 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 @@ -59,6 +59,7 @@ import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; import org.sonarqube.ws.client.resources.ResourcesService; import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; +import org.sonarqube.ws.client.securityreports.SecurityReportsService; import org.sonarqube.ws.client.server.ServerService; import org.sonarqube.ws.client.settings.SettingsService; import org.sonarqube.ws.client.sources.SourcesService; @@ -140,6 +141,7 @@ class DefaultWsClient implements WsClient { private final WebhooksService webhooksService; private final WebservicesService webservicesService; private final BatchService batchService; + private final SecurityReportsService securityReportsService; DefaultWsClient(WsConnector wsConnector) { this.wsConnector = wsConnector; @@ -198,6 +200,7 @@ class DefaultWsClient implements WsClient { this.webhooksService = new WebhooksService(wsConnector); this.webservicesService = new WebservicesService(wsConnector); this.batchService = new BatchService(wsConnector); + this.securityReportsService = new SecurityReportsService(wsConnector); } @Override @@ -476,4 +479,9 @@ class DefaultWsClient implements WsClient { return batchService; } + @Override + public SecurityReportsService securityReports() { + return securityReportsService; + } + } 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 387e7258f45..922659a8c11 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 @@ -59,6 +59,7 @@ import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; import org.sonarqube.ws.client.resources.ResourcesService; import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; +import org.sonarqube.ws.client.securityreports.SecurityReportsService; import org.sonarqube.ws.client.server.ServerService; import org.sonarqube.ws.client.settings.SettingsService; import org.sonarqube.ws.client.sources.SourcesService; @@ -205,4 +206,6 @@ public interface WsClient { WebservicesService webservices(); BatchService batch(); + + SecurityReportsService securityReports(); } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/SecurityReportsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/SecurityReportsService.java new file mode 100644 index 00000000000..3715e31c548 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/SecurityReportsService.java @@ -0,0 +1,54 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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.securityreports; + +import javax.annotation.Generated; +import org.sonarqube.ws.client.BaseService; +import org.sonarqube.ws.client.GetRequest; +import org.sonarqube.ws.client.WsConnector; +import org.sonarqube.ws.SecurityReports.ShowWsResponse; + +/** + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/security_reports">Further information about this web service online</a> + */ +@Generated("sonar-ws-generator") +public class SecurityReportsService extends BaseService { + + public SecurityReportsService(WsConnector wsConnector) { + super(wsConnector, "api/security_reports"); + } + + /** + * + * This is part of the internal API. + * This is a GET request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/security_reports/show">Further information about this action online (including a response example)</a> + * @since 7.3 + */ + public ShowWsResponse show(ShowRequest request) { + return call( + new GetRequest(path("show")) + .setParam("branch", request.getBranch()) + .setParam("includeDistribution", request.getIncludeDistribution()) + .setParam("project", request.getProject()) + .setParam("standard", request.getStandard()), + ShowWsResponse.parser()); + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/ShowRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/ShowRequest.java new file mode 100644 index 00000000000..8ebf0487e6e --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/ShowRequest.java @@ -0,0 +1,97 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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.securityreports; + +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/security_reports/show">Further information about this action online (including a response example)</a> + * @since 7.3 + */ +@Generated("sonar-ws-generator") +public class ShowRequest { + + private String branch; + private String includeDistribution; + private String project; + private String standard; + + /** + * Example value: "branch-2.0" + */ + public ShowRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * Possible values: + * <ul> + * <li>"true"</li> + * <li>"false"</li> + * <li>"yes"</li> + * <li>"no"</li> + * </ul> + */ + public ShowRequest setIncludeDistribution(String includeDistribution) { + this.includeDistribution = includeDistribution; + return this; + } + + public String getIncludeDistribution() { + return includeDistribution; + } + + /** + * This is a mandatory parameter. + */ + public ShowRequest setProject(String project) { + this.project = project; + return this; + } + + public String getProject() { + return project; + } + + /** + * This is a mandatory parameter. + * Possible values: + * <ul> + * <li>"owaspTop10"</li> + * <li>"sansTop25"</li> + * </ul> + */ + public ShowRequest setStandard(String standard) { + this.standard = standard; + return this; + } + + public String getStandard() { + return standard; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/package-info.java new file mode 100644 index 00000000000..fdcd51bf2f9 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/securityreports/package-info.java @@ -0,0 +1,26 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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.securityreports; + +import javax.annotation.ParametersAreNonnullByDefault; +import javax.annotation.Generated; + |