aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-06-12 14:12:28 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-06-20 04:10:53 -0700
commit63a867fea1b93981a777caec76077cea9342c4c5 (patch)
treef535374b44673e0cb2aa33a19e87b8d1bc3beb0e /sonar-ws
parent3d443765f55e9cea1c09f858598538991e39aa49 (diff)
downloadsonarqube-63a867fea1b93981a777caec76077cea9342c4c5.tar.gz
sonarqube-63a867fea1b93981a777caec76077cea9342c4c5.zip
SONAR-9356 Add ITs on onboardning
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersService.java6
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java1
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java6
3 files changed, 13 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersService.java
index 55d75aab734..5c1da476c1a 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersService.java
@@ -21,6 +21,7 @@ package org.sonarqube.ws.client.user;
import java.util.List;
import org.sonarqube.ws.WsUsers.CreateWsResponse;
+import org.sonarqube.ws.WsUsers.CurrentWsResponse;
import org.sonarqube.ws.WsUsers.GroupsWsResponse;
import org.sonarqube.ws.WsUsers.SearchWsResponse;
import org.sonarqube.ws.client.BaseService;
@@ -34,6 +35,7 @@ import static org.sonar.api.server.ws.WebService.Param.PAGE;
import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
import static org.sonar.api.server.ws.WebService.Param.TEXT_QUERY;
import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_CREATE;
+import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_CURRENT;
import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_GROUPS;
import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_SEARCH;
import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_SKIP_ONBOARDING_TUTORIAL;
@@ -94,6 +96,10 @@ public class UsersService extends BaseService {
GroupsWsResponse.parser());
}
+ public CurrentWsResponse current() {
+ return call(new GetRequest(path(ACTION_CURRENT)), CurrentWsResponse.parser());
+ }
+
public WsResponse skipOnboardingTutorial() {
return call(new PostRequest(path(ACTION_SKIP_ONBOARDING_TUTORIAL)));
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java
index 6ffecd751b0..2e648e047a5 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java
@@ -28,6 +28,7 @@ public class UsersWsParameters {
public static final String ACTION_UPDATE = "update";
public static final String ACTION_GROUPS = "groups";
public static final String ACTION_SKIP_ONBOARDING_TUTORIAL = "skip_onboarding_tutorial";
+ public static final String ACTION_CURRENT = "current";
public static final String PARAM_ORGANIZATION = "organization";
public static final String PARAM_LOGIN = "login";
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
index 0933d16b26c..7d26c5f238a 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/user/UsersServiceTest.java
@@ -129,4 +129,10 @@ public class UsersServiceTest {
.andNoOtherParam();
}
+ @Test
+ public void current() {
+ underTest.current();
+
+ assertThat(serviceTester.getGetParser()).isSameAs(WsUsers.CurrentWsResponse.parser());
+ }
}