diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-01-19 19:01:51 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-01-19 19:01:51 +0100 |
commit | 062387460b8834fdb637f27ac58d56634bad83b2 (patch) | |
tree | f1b78423fbf06795eac407ec011646b1c62fa857 /sonar-ws | |
parent | 70fb31a42d93ee99b19ffaf2db2a6f930a77a39f (diff) | |
download | sonarqube-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.java | 18 |
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())); + } + } |