diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-08-09 11:11:19 -0500 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-09-24 20:21:14 +0200 |
commit | de98b76b55959ad10c86d9f1eca0e4d792034f39 (patch) | |
tree | 59d99914fa6d141c385305227f9e99f8e0722bb0 | |
parent | 9b3a7cddc055ec66093cd7a29e26210fb9918dbb (diff) | |
download | sonarqube-de98b76b55959ad10c86d9f1eca0e4d792034f39.tar.gz sonarqube-de98b76b55959ad10c86d9f1eca0e4d792034f39.zip |
SONAR-12366 Add WS to tester
7 files changed, 316 insertions, 1 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/DeleteNewCodePeriodActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/DeleteNewCodePeriodActionTest.java index a04c216091c..ace4cf9d9ae 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/DeleteNewCodePeriodActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/DeleteNewCodePeriodActionTest.java @@ -180,7 +180,7 @@ public class DeleteNewCodePeriodActionTest { ws.newRequest() .setParam("project", project.getKey()) .execute(); - assertTableContainsOnly(project.uuid(), null, NewCodePeriodType.PREVIOUS_VERSION, null); + assertTableEmpty(); ws.newRequest() .setParam("project", project.getKey()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/plugins/DownloadRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/plugins/DownloadRequest.java new file mode 100644 index 00000000000..72d31d22864 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/plugins/DownloadRequest.java @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.plugins; + +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/plugins/download">Further information about this action online (including a response example)</a> + * @since 7.2 + */ +@Generated("sonar-ws-generator") +public class DownloadRequest { + + private String acceptCompressions; + private String plugin; + + /** + * Example value: "pack200" + */ + public DownloadRequest setAcceptCompressions(String acceptCompressions) { + this.acceptCompressions = acceptCompressions; + return this; + } + + public String getAcceptCompressions() { + return acceptCompressions; + } + + /** + * This is a mandatory parameter. + * Example value: "cobol" + */ + public DownloadRequest setPlugin(String plugin) { + this.plugin = plugin; + return this; + } + + public String getPlugin() { + return plugin; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalyses/SetBaselineRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalyses/SetBaselineRequest.java new file mode 100644 index 00000000000..455a8916442 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalyses/SetBaselineRequest.java @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.projectanalyses; + +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/project_analyses/set_baseline">Further information about this action online (including a response example)</a> + * @since 7.7 + */ +@Generated("sonar-ws-generator") +public class SetBaselineRequest { + + private String analysis; + private String branch; + private String project; + + /** + * This is a mandatory parameter. + * Example value: "AU-Tpxb--iU5OvuD2FLy" + */ + public SetBaselineRequest setAnalysis(String analysis) { + this.analysis = analysis; + return this; + } + + public String getAnalysis() { + return analysis; + } + + /** + */ + public SetBaselineRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * This is a mandatory parameter. + */ + public SetBaselineRequest 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/projectanalyses/UnsetBaselineRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalyses/UnsetBaselineRequest.java new file mode 100644 index 00000000000..aa2be412534 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalyses/UnsetBaselineRequest.java @@ -0,0 +1,59 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.projectanalyses; + +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/project_analyses/unset_baseline">Further information about this action online (including a response example)</a> + * @since 7.7 + */ +@Generated("sonar-ws-generator") +public class UnsetBaselineRequest { + + private String branch; + private String project; + + /** + */ + public UnsetBaselineRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * This is a mandatory parameter. + */ + public UnsetBaselineRequest 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/settings/DeleteNewCodePeriodRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/DeleteNewCodePeriodRequest.java new file mode 100644 index 00000000000..9b81df3ebe7 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/DeleteNewCodePeriodRequest.java @@ -0,0 +1,58 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.settings; + +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/settings/delete_new_code_period">Further information about this action online (including a response example)</a> + * @since 8.0 + */ +@Generated("sonar-ws-generator") +public class DeleteNewCodePeriodRequest { + + private String branch; + private String project; + + /** + */ + public DeleteNewCodePeriodRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + */ + public DeleteNewCodePeriodRequest 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/settings/SettingsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java index 123900c217f..bcb034d4797 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java @@ -57,6 +57,22 @@ public class SettingsService extends BaseService { } /** + * + * This is part of the internal API. + * This is a GET request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/delete_new_code_period">Further information about this action online (including a response example)</a> + * @since 8.0 + */ + public void deleteNewCodePeriod(DeleteNewCodePeriodRequest request) { + call( + new GetRequest(path("delete_new_code_period")) + .setParam("branch", request.getBranch()) + .setParam("project", request.getProject()) + .setMediaType(MediaTypes.JSON) + ).content(); + } + + /** * This is part of the internal API. * This is a GET request. * diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/sources/IssueSnippetsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/sources/IssueSnippetsRequest.java new file mode 100644 index 00000000000..c7761b5d42b --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/sources/IssueSnippetsRequest.java @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.sources; + +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/sources/issue_snippets">Further information about this action online (including a response example)</a> + * @since 7.8 + */ +@Generated("sonar-ws-generator") +public class IssueSnippetsRequest { + + private String issueKey; + + /** + * This is a mandatory parameter. + * Example value: "AU-Tpxb--iU5OvuD2FLy" + */ + public IssueSnippetsRequest setIssueKey(String issueKey) { + this.issueKey = issueKey; + return this; + } + + public String getIssueKey() { + return issueKey; + } +} |