diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-10-18 11:52:57 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-10-19 14:36:58 +0200 |
commit | 2fad0bfc3b20e8effb7e192d1eab210419149236 (patch) | |
tree | 8c28bcb778f7ee8e6669020ad23f17c60327028f /sonar-ws | |
parent | 52182f4c03060541d98bdd41e732788d53d6f65a (diff) | |
download | sonarqube-2fad0bfc3b20e8effb7e192d1eab210419149236.tar.gz sonarqube-2fad0bfc3b20e8effb7e192d1eab210419149236.zip |
Set branches WS as public and fix description
Diffstat (limited to 'sonar-ws')
3 files changed, 8 insertions, 5 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java index 32501503293..1df51cf37d0 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java @@ -33,6 +33,7 @@ public class ProjectBranchesParameters { public static final String PARAM_PROJECT = "project"; public static final String PARAM_COMPONENT = "component"; public static final String PARAM_BRANCH = "branch"; + public static final String PARAM_NAME = "name"; private ProjectBranchesParameters() { // static utility class diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java index 52d25fb4614..75ad3bdaec7 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java @@ -26,12 +26,13 @@ import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsConnector; -import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_LIST; -import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_SHOW; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_DELETE; +import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_LIST; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_RENAME; +import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_SHOW; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.CONTROLLER; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH; +import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_NAME; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT; public class ProjectBranchesService extends BaseService { @@ -60,10 +61,10 @@ public class ProjectBranchesService extends BaseService { call(post); } - public void rename(String project, String branch) { + public void rename(String project, String name) { PostRequest post = new PostRequest(path(ACTION_RENAME)) .setParam(PARAM_PROJECT, project) - .setParam(PARAM_BRANCH, branch); + .setParam(PARAM_NAME, name); call(post); } diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java index a1596299511..eb8f57f3444 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java @@ -32,6 +32,7 @@ import org.sonarqube.ws.client.WsConnector; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH; +import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_NAME; import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT; public class ProjectBranchesServiceTest { @@ -88,7 +89,7 @@ public class ProjectBranchesServiceTest { serviceTester.assertThat(postRequest) .hasPath("rename") .hasParam(PARAM_PROJECT, "projectKey") - .hasParam(PARAM_BRANCH, "my_branch") + .hasParam(PARAM_NAME, "my_branch") .andNoOtherParam(); } |