aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2022-04-26 10:46:05 +0200
committersonartech <sonartech@sonarsource.com>2022-04-29 20:03:19 +0000
commit0e8b19279b5c24eb73bcfbc225264ead31796fc7 (patch)
treea6ff2a4a9e089e97afddaae461b643fd9c78951b /sonar-ws
parentee403812eb9f4ff28571ed188d9d0929f7a592b6 (diff)
downloadsonarqube-0e8b19279b5c24eb73bcfbc225264ead31796fc7.tar.gz
sonarqube-0e8b19279b5c24eb73bcfbc225264ead31796fc7.zip
SONAR-16263 Added integration tests
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java21
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java4
2 files changed, 24 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
index ba5b8a35d41..c0b3214b7d8 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java
@@ -20,6 +20,7 @@
package org.sonarqube.ws.client.usertokens;
import javax.annotation.Generated;
+import javax.annotation.Nullable;
/**
* This is part of the internal API.
@@ -32,6 +33,8 @@ public class GenerateRequest {
private String login;
private String name;
+ private String type;
+ private String projectKey;
/**
* Example value: "g.hopper"
@@ -57,4 +60,22 @@ public class GenerateRequest {
public String getName() {
return name;
}
+
+ public String getType() {
+ return type;
+ }
+
+ public GenerateRequest setType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public GenerateRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
index 93e7adb6ffd..1539acc65f2 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java
@@ -49,7 +49,9 @@ public class UserTokensService extends BaseService {
return call(
new PostRequest(path("generate"))
.setParam("login", request.getLogin())
- .setParam("name", request.getName()),
+ .setParam("name", request.getName())
+ .setParam("type", request.getType())
+ .setParam("projectKey", request.getProjectKey()),
GenerateWsResponse.parser());
}