aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-08-17 15:13:29 +0200
committerJanos Gyerik <janos.gyerik@sonarsource.com>2017-09-12 11:01:38 +0200
commit139467cf51932ba232190f363ad864e60eb3fd4d (patch)
tree161ae87672a3c9d300dddf2b0e8170e9b66107a2 /sonar-ws
parentfec874489985e355d8f47201a750ba9b0647f53e (diff)
downloadsonarqube-139467cf51932ba232190f363ad864e60eb3fd4d.tar.gz
sonarqube-139467cf51932ba232190f363ad864e60eb3fd4d.zip
Add TreeWsRequest#component to replace baseComponentKey
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java3
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java27
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java2
3 files changed, 31 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java
index e9a49cfe0b8..95279bba0c6 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java
@@ -65,7 +65,8 @@ public class ComponentsService extends BaseService {
public TreeWsResponse tree(TreeWsRequest request) {
GetRequest get = new GetRequest(path(ACTION_TREE))
.setParam(PARAM_COMPONENT_ID, request.getBaseComponentId())
- .setParam(PARAM_COMPONENT, request.getBaseComponentKey())
+ .setParam("baseComponentKey", request.getBaseComponentKey())
+ .setParam(PARAM_COMPONENT, request.getComponent())
.setParam(PARAM_BRANCH, request.getBranch())
.setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers()))
.setParam(PARAM_STRATEGY, request.getStrategy())
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java
index 7b03a70262e..d941300974c 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java
@@ -26,6 +26,7 @@ import javax.annotation.Nullable;
public class TreeWsRequest {
private String baseComponentId;
private String baseComponentKey;
+ private String component;
private String branch;
private String strategy;
private List<String> qualifiers;
@@ -35,26 +36,52 @@ public class TreeWsRequest {
private Integer page;
private Integer pageSize;
+ /**
+ * @deprecated since 6.4, please use {@link #getComponent()} instead
+ */
+ @Deprecated
@CheckForNull
public String getBaseComponentId() {
return baseComponentId;
}
+ /**
+ * @deprecated since 6.4, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
public TreeWsRequest setBaseComponentId(@Nullable String baseComponentId) {
this.baseComponentId = baseComponentId;
return this;
}
+ /**
+ * @deprecated since 6.4, please use {@link #getComponent()} instead
+ */
+ @Deprecated
@CheckForNull
public String getBaseComponentKey() {
return baseComponentKey;
}
+ /**
+ * @deprecated since 6.4, please use {@link #setComponent(String)} instead
+ */
+ @Deprecated
public TreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) {
this.baseComponentKey = baseComponentKey;
return this;
}
+ public TreeWsRequest setComponent(@Nullable String component) {
+ this.component = component;
+ return this;
+ }
+
+ @CheckForNull
+ public String getComponent() {
+ return component;
+ }
+
@CheckForNull
public String getBranch() {
return branch;
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java
index 8b73590c1ee..61805bbdd1a 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/component/ComponentsServiceTest.java
@@ -163,6 +163,7 @@ public class ComponentsServiceTest {
underTest.tree(new TreeWsRequest()
.setBaseComponentId(componentId)
.setBaseComponentKey(componentKey)
+ .setComponent(componentKey)
.setBranch("my_branch")
.setQualifiers(asList("q1", "q2"))
.setStrategy(strategy)
@@ -175,6 +176,7 @@ public class ComponentsServiceTest {
serviceTester.assertThat(serviceTester.getGetRequest())
.hasPath("tree")
.hasParam("componentId", componentId)
+ .hasParam("baseComponentKey", componentKey)
.hasParam("component", componentKey)
.hasParam("branch", "my_branch")
.hasParam("qualifiers", "q1,q2")