aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-19 19:01:51 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-19 19:01:51 +0100
commit062387460b8834fdb637f27ac58d56634bad83b2 (patch)
treef1b78423fbf06795eac407ec011646b1c62fa857 /sonar-ws
parent70fb31a42d93ee99b19ffaf2db2a6f930a77a39f (diff)
downloadsonarqube-062387460b8834fdb637f27ac58d56634bad83b2.tar.gz
sonarqube-062387460b8834fdb637f27ac58d56634bad83b2.zip
SONAR-7210 SONAR-7209 WS user_tokens/* add IT
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java
index 0fdbc00a16d..a87734cda3f 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java
@@ -20,11 +20,15 @@
package org.sonarqube.ws.client.usertoken;
import org.sonarqube.ws.WsUserTokens.GenerateWsResponse;
+import org.sonarqube.ws.WsUserTokens.SearchWsResponse;
import org.sonarqube.ws.client.BaseService;
+import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.client.WsConnector;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_GENERATE;
+import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_REVOKE;
+import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_SEARCH;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.CONTROLLER;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
@@ -42,4 +46,18 @@ public class UserTokensService extends BaseService {
.setParam(PARAM_NAME, request.getName()),
GenerateWsResponse.parser());
}
+
+ public SearchWsResponse search(SearchWsRequest request) {
+ return call(
+ new GetRequest(path(ACTION_SEARCH)).setParam(PARAM_LOGIN, request.getLogin()),
+ SearchWsResponse.parser());
+ }
+
+ public void revoke(RevokeWsRequest request) {
+ call(
+ new PostRequest(path(ACTION_REVOKE))
+ .setParam(PARAM_LOGIN, request.getLogin())
+ .setParam(PARAM_NAME, request.getName()));
+ }
+
}