From e7cfc7f04f41fa7dde069844cc80d710913cb63e Mon Sep 17 00:00:00 2001 From: Viktor Vorona Date: Wed, 20 Nov 2024 17:38:49 +0100 Subject: SONAR-23654 Mode Tour --- .../testFixtures/java/org/sonarqube/ws/tester/UserTester.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sonar-ws') 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(); } -- cgit v1.2.3