diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-02-15 10:16:39 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-02-15 14:24:41 +0100 |
commit | e1700f3dc7d4b52d62d0ac707eeeaace0f5ad772 (patch) | |
tree | 6f6aaa39dbb34115e09d99dcbcbcecc034917873 /sonar-ws | |
parent | 2679df38cca5c450b163ebaad139c435fddc14ca (diff) | |
download | sonarqube-e1700f3dc7d4b52d62d0ac707eeeaace0f5ad772.tar.gz sonarqube-e1700f3dc7d4b52d62d0ac707eeeaace0f5ad772.zip |
SONAR-7319 WS api/ce/task_types list CE task types
Diffstat (limited to 'sonar-ws')
3 files changed, 19 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java index b11cfdfb60e..66aa65812ed 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java @@ -21,6 +21,7 @@ package org.sonarqube.ws.client.ce; import org.sonarqube.ws.WsCe.ActivityResponse; +import org.sonarqube.ws.WsCe.TaskTypesWsResponse; import org.sonarqube.ws.client.BaseService; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsConnector; @@ -54,4 +55,8 @@ public class CeService extends BaseService { ActivityResponse.parser()); } + public TaskTypesWsResponse taskTypes() { + return call(new GetRequest(path("task_types")), TaskTypesWsResponse.parser()); + } + } diff --git a/sonar-ws/src/main/protobuf/ws-ce.proto b/sonar-ws/src/main/protobuf/ws-ce.proto index 9c27b02f4c9..8a8a3f85036 100644 --- a/sonar-ws/src/main/protobuf/ws-ce.proto +++ b/sonar-ws/src/main/protobuf/ws-ce.proto @@ -54,6 +54,11 @@ message ProjectResponse { optional Task current = 2; } +// GET api/ce/task_types +message TaskTypesWsResponse { + repeated string taskTypes = 1; +} + message Task { optional string id = 1; optional string type = 2; diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/ce/CeServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/ce/CeServiceTest.java index d7094f75495..f93004ffcbc 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/ce/CeServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/ce/CeServiceTest.java @@ -23,6 +23,7 @@ package org.sonarqube.ws.client.ce; import com.google.common.collect.ImmutableList; import org.junit.Rule; import org.junit.Test; +import org.sonarqube.ws.WsCe; import org.sonarqube.ws.WsCe.ActivityResponse; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.ServiceTester; @@ -56,7 +57,7 @@ public class CeServiceTest { CeService underTest = serviceTester.getInstanceUnderTest(); @Test - public void search() { + public void activity() { ActivityWsRequest request = new ActivityWsRequest() .setComponentId(VALUE_COMPONENT_ID) .setComponentQuery(VALUE_COMPONENT_QUERY) @@ -87,4 +88,11 @@ public class CeServiceTest { .hasParam("ps", 1) .andNoOtherParam(); } + + @Test + public void task_types() { + underTest.taskTypes(); + + assertThat(serviceTester.getGetParser()).isSameAs(WsCe.TaskTypesWsResponse.parser()); + } } |