]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7835 Delete old permissions.UsersAction
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 8 Jul 2016 13:21:36 +0000 (15:21 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 12 Jul 2016 08:16:53 +0000 (10:16 +0200)
server/sonar-server/src/main/java/org/sonar/server/permission/ws/OldUsersAction.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsModule.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/UsersAction.java
server/sonar-server/src/main/resources/org/sonar/server/permission/ws/old-users-example.json [deleted file]
server/sonar-server/src/test/java/org/sonar/server/permission/ws/OldUsersActionTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsModuleTest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java
sonar-ws/src/main/protobuf/ws-permissions.proto
sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java

diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/OldUsersAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/OldUsersAction.java
deleted file mode 100644 (file)
index fbee4d1..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.permission.ws;
-
-import com.google.common.base.Optional;
-import java.util.List;
-import org.sonar.api.server.ws.Request;
-import org.sonar.api.server.ws.Response;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.api.server.ws.WebService.Param;
-import org.sonar.api.server.ws.WebService.SelectionMode;
-import org.sonar.api.utils.Paging;
-import org.sonar.db.DbClient;
-import org.sonar.db.DbSession;
-import org.sonar.db.component.ComponentDto;
-import org.sonar.db.permission.OldPermissionQuery;
-import org.sonar.db.permission.UserWithPermissionDto;
-import org.sonar.server.permission.PermissionFinder;
-import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.WsPermissions;
-import org.sonarqube.ws.WsPermissions.OldUsersWsResponse;
-import org.sonarqube.ws.client.permission.OldUsersWsRequest;
-
-import static com.google.common.base.MoreObjects.firstNonNull;
-import static com.google.common.base.Strings.nullToEmpty;
-import static org.sonar.api.utils.Paging.forPageIndex;
-import static org.sonar.server.permission.PermissionPrivilegeChecker.checkProjectAdminUserByComponentDto;
-import static org.sonar.server.permission.ws.PermissionQueryParser.fromSelectionModeToMembership;
-import static org.sonar.server.permission.ws.PermissionRequestValidator.validatePermission;
-import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
-import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
-import static org.sonar.server.permission.ws.WsProjectRef.newOptionalWsProjectRef;
-import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-
-public class OldUsersAction implements PermissionsWsAction {
-
-  private final DbClient dbClient;
-  private final UserSession userSession;
-  private final PermissionFinder permissionFinder;
-  private final PermissionDependenciesFinder dependenciesFinder;
-
-  public OldUsersAction(DbClient dbClient, UserSession userSession, PermissionFinder permissionFinder, PermissionDependenciesFinder dependenciesFinder) {
-    this.dbClient = dbClient;
-    this.userSession = userSession;
-    this.permissionFinder = permissionFinder;
-    this.dependenciesFinder = dependenciesFinder;
-  }
-
-  @Override
-  public void define(WebService.NewController context) {
-    WebService.NewAction action = context.createAction("users")
-      .setSince("5.2")
-      .setDescription(String.format("Lists the users that have been granted the specified permission as individual users rather than through group affiliation. <br />" +
-        "This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.<br /> " +
-        "If the query parameter '%s' is specified, the '%s' parameter is forced to '%s'.<br />" +
-        "It requires administration permissions to access.<br />",
-        Param.TEXT_QUERY, Param.SELECTED, SelectionMode.ALL.value()))
-      .addPagingParams(100)
-      .addSearchQuery("stas", "names")
-      .addSelectionModeParam()
-      .setInternal(true)
-      .setResponseExample(getClass().getResource("old-users-example.json"))
-      .setHandler(this);
-
-    createPermissionParameter(action);
-    createProjectParameters(action);
-  }
-
-  @Override
-  public void handle(Request wsRequest, Response wsResponse) throws Exception {
-    OldUsersWsResponse usersWsResponse = doHandle(toUsersWsRequest(wsRequest));
-    writeProtobuf(usersWsResponse, wsRequest, wsResponse);
-  }
-
-  private OldUsersWsResponse doHandle(OldUsersWsRequest request) {
-    Optional<WsProjectRef> wsProjectRef = newOptionalWsProjectRef(request.getProjectId(), request.getProjectKey());
-    validatePermission(request.getPermission(), wsProjectRef);
-    DbSession dbSession = dbClient.openSession(false);
-    try {
-      Optional<ComponentDto> project = dependenciesFinder.searchProject(dbSession, wsProjectRef);
-      checkProjectAdminUserByComponentDto(userSession, project);
-      OldPermissionQuery permissionQuery = buildPermissionQuery(request, project);
-      Long projectIdIfPresent = project.isPresent() ? project.get().getId() : null;
-      int total = dbClient.permissionDao().countUsers(dbSession, permissionQuery, projectIdIfPresent);
-      List<UserWithPermissionDto> usersWithPermission = permissionFinder.findUsersWithPermission(dbSession, permissionQuery);
-      return buildResponse(usersWithPermission, forPageIndex(request.getPage()).withPageSize(request.getPageSize()).andTotal(total));
-    } finally {
-      dbClient.closeSession(dbSession);
-    }
-  }
-
-  private static OldUsersWsRequest toUsersWsRequest(Request request) {
-    return new OldUsersWsRequest()
-      .setPermission(request.mandatoryParam(PARAM_PERMISSION))
-      .setProjectId(request.param(PARAM_PROJECT_ID))
-      .setProjectKey(request.param(PARAM_PROJECT_KEY))
-      .setSelected(request.param(Param.SELECTED))
-      .setQuery(request.param(Param.TEXT_QUERY))
-      .setPage(request.mandatoryParamAsInt(Param.PAGE))
-      .setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE));
-  }
-
-  private static OldUsersWsResponse buildResponse(List<UserWithPermissionDto> usersWithPermission, Paging paging) {
-    OldUsersWsResponse.Builder userResponse = OldUsersWsResponse.newBuilder();
-    WsPermissions.OldUser.Builder user = WsPermissions.OldUser.newBuilder();
-    for (UserWithPermissionDto userWithPermission : usersWithPermission) {
-      userResponse.addUsers(
-        user
-          .clear()
-          .setLogin(userWithPermission.getLogin())
-          .setName(nullToEmpty(userWithPermission.getName()))
-          .setEmail(nullToEmpty(userWithPermission.getEmail()))
-          .setSelected(userWithPermission.getPermission() != null));
-    }
-
-    userResponse.getPagingBuilder()
-      .clear()
-      .setPageIndex(paging.pageIndex())
-      .setPageSize(paging.pageSize())
-      .setTotal(paging.total())
-      .build();
-
-    return userResponse.build();
-  }
-
-  private static OldPermissionQuery buildPermissionQuery(OldUsersWsRequest request, Optional<ComponentDto> project) {
-    OldPermissionQuery.Builder permissionQuery = OldPermissionQuery.builder()
-      .permission(request.getPermission())
-      .pageIndex(request.getPage())
-      .pageSize(request.getPageSize())
-      .membership(fromSelectionModeToMembership(firstNonNull(request.getSelected(), SelectionMode.SELECTED.value())))
-      .search(request.getQuery());
-    if (project.isPresent()) {
-      permissionQuery.component(project.get().getKey());
-    }
-
-    return permissionQuery.build();
-  }
-}
index c2d512854079dbaea581e91c3a04b19a7bf42481..7a74309f47ecb2622ab566035cf66d773540fb6c 100644 (file)
@@ -45,7 +45,6 @@ public class PermissionsWsModule extends Module {
       AddUserAction.class,
       RemoveGroupAction.class,
       RemoveUserAction.class,
-      OldUsersAction.class,
       UsersAction.class,
       GroupsAction.class,
       SearchGlobalPermissionsAction.class,
index 3fc29983a57d04be98f836e0eb332d546f90f295..065cb0157774f3044acb131f20e236ee6e5eac77 100644 (file)
@@ -73,7 +73,7 @@ public class UsersAction implements PermissionsWsAction {
 
   @Override
   public void define(WebService.NewController context) {
-    WebService.NewAction action = context.createAction("users2")
+    WebService.NewAction action = context.createAction("users")
       .setSince("5.2")
       .setDescription("Lists the users with their permissions as individual users rather than through group affiliation.<br>" +
         "This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.<br> " +
diff --git a/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/old-users-example.json b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/old-users-example.json
deleted file mode 100644 (file)
index 5f13cd5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "users": [
-    {
-      "login": "admin",
-      "name": "Administrator",
-      "email": "admin@admin.com",
-      "selected": true
-    },
-    {
-      "login": "george.orwell",
-      "name": "George Orwell",
-      "email": "george.orwell@1984.net",
-      "selected": true
-    }
-  ],
-  "paging": {
-    "pageSize": 100,
-    "total": 2,
-    "pageIndex": 1
-  }
-}
-
diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/OldUsersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/OldUsersActionTest.java
deleted file mode 100644 (file)
index 5bf5c3c..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.permission.ws;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.server.ws.WebService.Param;
-import org.sonar.api.server.ws.WebService.SelectionMode;
-import org.sonar.api.utils.System2;
-import org.sonar.api.web.UserRole;
-import org.sonar.db.DbClient;
-import org.sonar.db.DbSession;
-import org.sonar.db.DbTester;
-import org.sonar.db.component.ComponentDto;
-import org.sonar.db.component.ResourceTypesRule;
-import org.sonar.db.user.UserDto;
-import org.sonar.db.user.UserPermissionDto;
-import org.sonar.server.component.ComponentFinder;
-import org.sonar.server.exceptions.BadRequestException;
-import org.sonar.server.exceptions.ForbiddenException;
-import org.sonar.server.exceptions.UnauthorizedException;
-import org.sonar.server.permission.PermissionFinder;
-import org.sonar.server.tester.UserSessionRule;
-import org.sonar.server.usergroups.ws.UserGroupFinder;
-import org.sonar.server.ws.WsActionTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonar.api.web.UserRole.ISSUE_ADMIN;
-import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION;
-import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
-import static org.sonar.db.component.ComponentTesting.newProjectDto;
-import static org.sonar.db.user.UserTesting.newUserDto;
-import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-
-public class OldUsersActionTest {
-
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  @Rule
-  public UserSessionRule userSession = UserSessionRule.standalone();
-
-  @Rule
-  public DbTester db = DbTester.create(System2.INSTANCE);
-  ResourceTypesRule resourceTypes = new ResourceTypesRule().setRootQualifiers(Qualifiers.PROJECT, Qualifiers.VIEW, "DEV");
-  DbClient dbClient = db.getDbClient();
-  DbSession dbSession = db.getSession();
-  WsActionTester ws;
-  OldUsersAction underTest;
-
-  @Before
-  public void setUp() {
-    PermissionFinder permissionFinder = new PermissionFinder(dbClient);
-    PermissionDependenciesFinder dependenciesFinder = new PermissionDependenciesFinder(dbClient, new ComponentFinder(dbClient), new UserGroupFinder(dbClient), resourceTypes);
-    underTest = new OldUsersAction(dbClient, userSession, permissionFinder, dependenciesFinder);
-    ws = new WsActionTester(underTest);
-
-    userSession.login("login").setGlobalPermissions(SYSTEM_ADMIN);
-  }
-
-  @Test
-  @Ignore("will be deleted")
-  public void search_for_users_with_response_example() {
-    UserDto user1 = insertUser(new UserDto().setLogin("admin").setName("Administrator").setEmail("admin@admin.com"));
-    UserDto user2 = insertUser(new UserDto().setLogin("george.orwell").setName("George Orwell").setEmail("george.orwell@1984.net"));
-    insertUserRole(new UserPermissionDto().setPermission(SCAN_EXECUTION).setUserId(user1.getId()));
-    insertUserRole(new UserPermissionDto().setPermission(SCAN_EXECUTION).setUserId(user2.getId()));
-    dbSession.commit();
-
-    String result = ws.newRequest().setParam("permission", "scan").execute().getInput();
-
-    assertJson(result).isSimilarTo(getClass().getResource("users-example.json"));
-  }
-
-  @Test
-  @Ignore("will be deleted")
-  public void search_for_users_with_one_permission() {
-    insertUsers();
-    String result = ws.newRequest().setParam("permission", "scan").execute().getInput();
-
-    assertJson(result).isSimilarTo(getClass().getResource("UsersActionTest/users.json"));
-  }
-
-  @Test
-  public void search_for_users_with_permission_on_project() {
-    dbClient.componentDao().insert(dbSession, newProjectDto("project-uuid").setKey("project-key"));
-    ComponentDto project = dbClient.componentDao().selectOrFailByUuid(dbSession, "project-uuid");
-    UserDto user = insertUser(newUserDto().setLogin("project-user-login").setName("project-user-name"));
-    insertUserRole(new UserPermissionDto().setPermission(ISSUE_ADMIN).setUserId(user.getId()).setComponentId(project.getId()));
-    dbSession.commit();
-    userSession.login().addProjectUuidPermissions(SYSTEM_ADMIN, "project-uuid");
-
-    String result = ws.newRequest()
-      .setParam(PARAM_PERMISSION, ISSUE_ADMIN)
-      .setParam(PARAM_PROJECT_ID, "project-uuid")
-      .execute().getInput();
-
-    assertThat(result).contains("project-user-login")
-      .doesNotContain("login-1");
-  }
-
-  @Test
-  public void search_for_users_with_query_as_a_parameter() {
-    insertUsers();
-    String result = ws.newRequest()
-      .setParam("permission", "scan")
-      .setParam(Param.TEXT_QUERY, "ame-1")
-      .execute().getInput();
-
-    assertThat(result).contains("login-1")
-      .doesNotContain("login-2")
-      .doesNotContain("login-3");
-  }
-
-  @Test
-  public void search_for_users_with_select_as_a_parameter() {
-    insertUsers();
-    String result = ws.newRequest()
-      .setParam("permission", "scan")
-      .setParam(Param.SELECTED, SelectionMode.ALL.value())
-      .execute().getInput();
-
-    assertThat(result).contains("login-1", "login-2", "login-3");
-  }
-
-  @Test
-  public void fail_if_project_permission_without_project() {
-    expectedException.expect(BadRequestException.class);
-
-    ws.newRequest()
-      .setParam(PARAM_PERMISSION, UserRole.ISSUE_ADMIN)
-      .setParam(Param.SELECTED, SelectionMode.ALL.value())
-      .execute();
-  }
-
-  @Test
-  public void fail_if_permission_parameter_is_not_filled() {
-    expectedException.expect(IllegalArgumentException.class);
-
-    ws.newRequest().execute();
-  }
-
-  @Test
-  public void fail_if_insufficient_privileges() {
-    expectedException.expect(ForbiddenException.class);
-    userSession.login("login");
-
-    ws.newRequest()
-      .setParam("permission", SYSTEM_ADMIN)
-      .execute();
-  }
-
-  @Test
-  public void fail_if_not_logged_in() {
-    expectedException.expect(UnauthorizedException.class);
-    userSession.anonymous();
-
-    ws.newRequest()
-      .setParam("permission", SYSTEM_ADMIN)
-      .execute();
-  }
-
-  @Test
-  public void fail_if_project_uuid_and_project_key_are_provided() {
-    expectedException.expect(BadRequestException.class);
-    expectedException.expectMessage("Project id or project key can be provided, not both.");
-    dbClient.componentDao().insert(dbSession, newProjectDto("project-uuid").setKey("project-key"));
-    dbSession.commit();
-
-    ws.newRequest()
-      .setParam(PARAM_PERMISSION, SYSTEM_ADMIN)
-      .setParam(PARAM_PROJECT_ID, "project-uuid")
-      .setParam(PARAM_PROJECT_KEY, "project-key")
-      .execute();
-  }
-
-  private UserDto insertUser(UserDto userDto) {
-    UserDto user = dbClient.userDao().insert(dbSession, userDto.setActive(true));
-    dbSession.commit();
-    return user;
-  }
-
-  private void insertUserRole(UserPermissionDto userPermissionDto) {
-    dbClient.roleDao().insertUserRole(dbSession, userPermissionDto);
-    dbSession.commit();
-  }
-
-  private void insertUsers() {
-    UserDto user1 = insertUser(new UserDto().setLogin("login-1").setName("name-1").setEmail("email-1"));
-    UserDto user2 = insertUser(new UserDto().setLogin("login-2").setName("name-2").setEmail("email-2"));
-    UserDto user3 = insertUser(new UserDto().setLogin("login-3").setName("name-3").setEmail("email-3"));
-    insertUserRole(new UserPermissionDto().setPermission(SCAN_EXECUTION).setUserId(user1.getId()));
-    insertUserRole(new UserPermissionDto().setPermission(SCAN_EXECUTION).setUserId(user2.getId()));
-    insertUserRole(new UserPermissionDto().setPermission(SYSTEM_ADMIN).setUserId(user3.getId()));
-    dbSession.commit();
-  }
-}
index 9e1b74355da78d032e4de937e17ade8312af5341..d238645c924cbc1143f6c3429d22b5745638fcd3 100644 (file)
@@ -29,6 +29,6 @@ public class PermissionsWsModuleTest {
   public void verify_count_of_added_components() {
     ComponentContainer container = new ComponentContainer();
     new PermissionsWsModule().configure(container);
-    assertThat(container.size()).isEqualTo(2 + 30);
+    assertThat(container.size()).isEqualTo(2 + 29);
   }
 }
index 697747e82199a5db2968752681ab8a9df068b22a..db7965e791f77bc2664da2ae5e82c471181d96de 100644 (file)
@@ -21,7 +21,6 @@ package org.sonarqube.ws.client.permission;
 
 import org.sonarqube.ws.WsPermissions;
 import org.sonarqube.ws.WsPermissions.CreateTemplateWsResponse;
-import org.sonarqube.ws.WsPermissions.OldUsersWsResponse;
 import org.sonarqube.ws.WsPermissions.SearchProjectPermissionsWsResponse;
 import org.sonarqube.ws.WsPermissions.SearchTemplatesWsResponse;
 import org.sonarqube.ws.WsPermissions.UpdateTemplateWsResponse;
@@ -214,19 +213,8 @@ public class PermissionsService extends BaseService {
       .setParam(PARAM_PROJECT_KEY_PATTERN, request.getProjectKeyPattern()), UpdateTemplateWsResponse.parser());
   }
 
-  public OldUsersWsResponse oldUsers(OldUsersWsRequest request) {
-    return call(new GetRequest(path("users"))
-      .setParam(PARAM_PERMISSION, request.getPermission())
-      .setParam(PARAM_PROJECT_ID, request.getProjectId())
-      .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-      .setParam("selected", request.getSelected())
-      .setParam("p", request.getPage())
-      .setParam("ps", request.getPageSize())
-      .setParam("q", request.getQuery()), OldUsersWsResponse.parser());
-  }
-
   public UsersWsResponse users(UsersWsRequest request) {
-    return call(new GetRequest(path("users2"))
+    return call(new GetRequest(path("users"))
       .setParam(PARAM_PERMISSION, request.getPermission())
       .setParam(PARAM_PROJECT_ID, request.getProjectId())
       .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
index ceb2a559dade27d2a42d8b270d7336d825c387e2..bbe40511eb4eaf5bffefd095c2873b3002bcdbf8 100644 (file)
@@ -26,15 +26,13 @@ option java_package = "org.sonarqube.ws";
 option java_outer_classname = "WsPermissions";
 option optimize_for = SPEED;
 
-// WS api/permissions/users for internal use only
-// and WS api/permissions/template_users for internal use only
+// WS api/permissions/template_users for internal use only
 message OldUsersWsResponse {
   optional sonarqube.ws.commons.Paging paging = 1;
   repeated OldUser users = 2;
 }
 
 // WS api/permissions/users for internal use only
-// and WS api/permissions/template_users for internal use only
 message UsersWsResponse {
   optional sonarqube.ws.commons.Paging paging = 1;
   repeated User users = 2;
index d0e4e0a52e6a019c4cf6fb0fa746aa7922605709..f430c5dd5f8dc62b9ed52804eaebf0e27daf63f4 100644 (file)
@@ -22,7 +22,6 @@ package org.sonarqube.ws.client.permission;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.ws.WsPermissions;
-import org.sonarqube.ws.WsPermissions.OldUsersWsResponse;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.ServiceTester;
@@ -430,32 +429,6 @@ public class PermissionsServiceTest {
       .andNoOtherParam();
   }
 
-  @Test
-  public void users_does_GET_on_Ws_users() {
-    underTest.oldUsers(new OldUsersWsRequest()
-      .setPermission(PERMISSION_VALUE)
-      .setProjectId(PROJECT_ID_VALUE)
-      .setProjectKey(PROJECT_KEY_VALUE)
-      .setSelected(SELECTED_VALUE)
-      .setPage(PAGE_VALUE)
-      .setPageSize(PAGE_SIZE_VALUE)
-      .setQuery(QUERY_VALUE)
-      );
-
-    assertThat(serviceTester.getGetParser()).isSameAs(OldUsersWsResponse.parser());
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-      .hasPath("users")
-      .hasParam(PARAM_PERMISSION, PERMISSION_VALUE)
-      .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE)
-      .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE)
-      .hasParam(PARAM_SELECTED, SELECTED_VALUE)
-      .hasParam(PARAM_P, PAGE_VALUE)
-      .hasParam(PARAM_PS, PAGE_SIZE_VALUE)
-      .hasParam(PARAM_Q, QUERY_VALUE)
-      .andNoOtherParam();
-  }
-
   @Test
   public void add_project_creator_to_template() {
     underTest.addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.builder()