aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2024-11-20 17:38:49 +0100
committersonartech <sonartech@sonarsource.com>2024-11-26 20:02:50 +0000
commite7cfc7f04f41fa7dde069844cc80d710913cb63e (patch)
tree7cacc1b36353f5661dac17f4fa7f0a628a8de088 /sonar-ws
parent25d891639704eee3fe00653f5f00e1519e76545e (diff)
downloadsonarqube-e7cfc7f04f41fa7dde069844cc80d710913cb63e.tar.gz
sonarqube-e7cfc7f04f41fa7dde069844cc80d710913cb63e.zip
SONAR-23654 Mode Tour
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java b/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java
index 350cb661a1a..9e00fa7e58e 100644
--- a/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java
+++ b/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java
@@ -29,7 +29,9 @@ import javax.annotation.Nullable;
import org.sonarqube.ws.UserTokens;
import org.sonarqube.ws.Users;
import org.sonarqube.ws.Users.CreateWsResponse.User;
+import org.sonarqube.ws.client.HttpConnector;
import org.sonarqube.ws.client.PostRequest;
+import org.sonarqube.ws.client.WsClientFactories;
import org.sonarqube.ws.client.WsResponse;
import org.sonarqube.ws.client.usergroups.AddUserRequest;
import org.sonarqube.ws.client.users.ChangePasswordRequest;
@@ -126,6 +128,7 @@ public class UserTester {
new org.sonarqube.ws.client.permissions.AddUserRequest()
.setLogin(u.getLogin())
.setPermission("admin"));
+ dismissModesTour(u);
return u;
}
@@ -137,9 +140,17 @@ public class UserTester {
User user = generate(populators);
session.wsClient().permissions().addUser(new org.sonarqube.ws.client.permissions.AddUserRequest().setLogin(user.getLogin()).setPermission("admin"));
session.wsClient().userGroups().addUser(new AddUserRequest().setLogin(user.getLogin()).setName("sonar-administrators"));
+ dismissModesTour(user);
return user;
}
+ private void dismissModesTour(User user) {
+ WsClientFactories.getDefault().newClient(HttpConnector.newBuilder()
+ .url(session.wsClient().wsConnector().baseUrl())
+ .credentials(user.getLogin(), user.getLogin())
+ .build()).users().dismissNotice("showNewModesTour");
+ }
+
public UsersService service() {
return session.wsClient().users();
}