diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-08-04 12:02:40 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-09-12 10:55:10 +0200 |
commit | 5c9f6c0ddd90b00de33f37bd1ce40b10935eaa27 (patch) | |
tree | c757f599841f7342e0223e0a4ec2addd00be0e3d /sonar-ws | |
parent | 4f500d461015eb6edc471677961c72e8e68b87bf (diff) | |
download | sonarqube-5c9f6c0ddd90b00de33f37bd1ce40b10935eaa27.tar.gz sonarqube-5c9f6c0ddd90b00de33f37bd1ce40b10935eaa27.zip |
SONAR-9616 Support branch in api/measures/component_tree
Diffstat (limited to 'sonar-ws')
3 files changed, 14 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java index d6c550eae92..0a89515828a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/ComponentTreeWsRequest.java @@ -28,6 +28,7 @@ public class ComponentTreeWsRequest { private String baseComponentId; private String baseComponentKey; private String component; + private String branch; private String strategy; private List<String> qualifiers; private List<String> additionalFields; @@ -90,6 +91,16 @@ public class ComponentTreeWsRequest { } @CheckForNull + public String getBranch() { + return branch; + } + + public ComponentTreeWsRequest setBranch(@Nullable String branch) { + this.branch = branch; + return this; + } + + @CheckForNull public String getStrategy() { return strategy; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java index 9c94c285667..db8b7e4bde2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/measure/MeasuresService.java @@ -61,6 +61,7 @@ public class MeasuresService extends BaseService { .setParam(DEPRECATED_PARAM_BASE_COMPONENT_ID, request.getBaseComponentId()) .setParam(DEPRECATED_PARAM_BASE_COMPONENT_KEY, request.getBaseComponentKey()) .setParam(PARAM_COMPONENT, request.getComponent()) + .setParam(PARAM_BRANCH, request.getBranch()) .setParam(PARAM_STRATEGY, request.getStrategy()) .setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers())) .setParam(PARAM_METRIC_KEYS, inlineMultipleParamValue(request.getMetricKeys())) diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java index b42cc3e45ad..c8d4e66d339 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/measure/MeasuresServiceTest.java @@ -114,6 +114,7 @@ public class MeasuresServiceTest { .setBaseComponentId(VALUE_BASE_COMPONENT_ID) .setBaseComponentKey(VALUE_BASE_COMPONENT_KEY) .setComponent(VALUE_BASE_COMPONENT_KEY) + .setBranch("my_branch") .setMetricKeys(VALUE_METRIC_KEYS) .setStrategy(VALUE_STRATEGY) .setQualifiers(VALUE_QUALIFIERS) @@ -136,6 +137,7 @@ public class MeasuresServiceTest { .hasParam(DEPRECATED_PARAM_BASE_COMPONENT_ID, VALUE_BASE_COMPONENT_ID) .hasParam(DEPRECATED_PARAM_BASE_COMPONENT_KEY, VALUE_BASE_COMPONENT_KEY) .hasParam(PARAM_COMPONENT, VALUE_BASE_COMPONENT_KEY) + .hasParam(PARAM_BRANCH, "my_branch") .hasParam(PARAM_METRIC_KEYS, "ncloc,complexity") .hasParam(PARAM_STRATEGY, VALUE_STRATEGY) .hasParam(PARAM_QUALIFIERS, "FIL,PRJ") |