From: Lukasz Jarocki Date: Wed, 1 Jun 2022 11:48:49 +0000 (+0200) Subject: SONAR-16370 Added integration test for new endpoint api/issues/pull X-Git-Tag: 9.5.0.56709~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=454325e57d675ebf2a83a6b699e97f6b6a1a424f;p=sonarqube.git SONAR-16370 Added integration test for new endpoint api/issues/pull --- diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java index 9978397decf..e61c8dce878 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java @@ -19,8 +19,10 @@ */ package org.sonarqube.ws.client.issues; +import java.io.InputStream; import java.util.stream.Collectors; import javax.annotation.Generated; +import org.sonarqube.ws.Issues; import org.sonarqube.ws.Issues.AddCommentResponse; import org.sonarqube.ws.Issues.AssignResponse; import org.sonarqube.ws.Issues.AuthorsResponse; @@ -38,6 +40,7 @@ import org.sonarqube.ws.client.BaseService; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsConnector; +import org.sonarqube.ws.client.batch.IssuesRequest; /** * @see Further information about this web service online @@ -299,4 +302,23 @@ public class IssuesService extends BaseService { .setParam("q", request.getQ()), TagsResponse.parser()); } + + /** + * + * This is part of the internal API. + * This is a GET request. + * @see Further information about this action online (including a response example) + * @since 9.5 + */ + public InputStream pull(PullRequest request) { + return call( + new GetRequest(path("pull")) + .setParam("projectKey", request.getProjectKey()) + .setParam("branchName", request.getBranchName()) + .setParam("languages", request.getLanguages()) + .setParam("ruleRepositories", request.getRuleRepositories()) + .setParam("resolvedOnly", request.getResolvedOnly()) + .setParam("changedSince", request.getChangedSince()) + ).contentStream(); + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/PullRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/PullRequest.java new file mode 100644 index 00000000000..176eb0d9b11 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/PullRequest.java @@ -0,0 +1,84 @@ +/* + * 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.issues; + +public class PullRequest { + + private String projectKey; + private String branchName; + private String languages; + private String ruleRepositories; + private String resolvedOnly; + private String changedSince; + + public String getProjectKey() { + return projectKey; + } + + public PullRequest setProjectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + + public String getBranchName() { + return branchName; + } + + public PullRequest setBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + public String getLanguages() { + return languages; + } + + public PullRequest setLanguages(String languages) { + this.languages = languages; + return this; + } + + public String getRuleRepositories() { + return ruleRepositories; + } + + public PullRequest setRuleRepositories(String ruleRepositories) { + this.ruleRepositories = ruleRepositories; + return this; + } + + public String getResolvedOnly() { + return resolvedOnly; + } + + public PullRequest setResolvedOnly(String resolvedOnly) { + this.resolvedOnly = resolvedOnly; + return this; + } + + public String getChangedSince() { + return changedSince; + } + + public PullRequest setChangedSince(String changedSince) { + this.changedSince = changedSince; + return this; + } +}