diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2020-09-08 11:53:56 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-09-09 20:07:14 +0000 |
commit | 4e2c7f4e37f3f1263a44a5e7fd612f553ec916ed (patch) | |
tree | 283adceba8153a67aac68245d74cbdb0a00b1e33 /server | |
parent | 6885b465d9fffa09f8c03b03ebd792f8669f9685 (diff) | |
download | sonarqube-4e2c7f4e37f3f1263a44a5e7fd612f553ec916ed.tar.gz sonarqube-4e2c7f4e37f3f1263a44a5e7fd612f553ec916ed.zip |
SONAR-13770 Fix user group update
Diffstat (limited to 'server')
3 files changed, 8 insertions, 8 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java index 64437873f3d..6e395ae9b61 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java @@ -147,7 +147,7 @@ public class GroupWsSupport { static UserGroups.Group.Builder toProtobuf(OrganizationDto organization, GroupDto group, int membersCount, boolean isDefault) { UserGroups.Group.Builder wsGroup = UserGroups.Group.newBuilder() - .setUuid(group.getUuid()) + .setId(group.getUuid()) .setOrganization(organization.getKey()) .setName(group.getName()) .setMembersCount(membersCount) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java index 2d9455fc5e0..74f60f0d113 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java @@ -141,7 +141,7 @@ public class SearchAction implements UserGroupsWsAction { private static Group toWsGroup(GroupDto group, Integer memberCount, Set<String> fields, boolean isDefault) { Group.Builder groupBuilder = Group.newBuilder() - .setUuid(group.getUuid()) + .setId(group.getUuid()) .setDefault(isDefault); if (fields.contains(FIELD_NAME)) { groupBuilder.setName(group.getName()); diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java index 504125cdefc..0819f659dd8 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java @@ -165,15 +165,15 @@ public class SearchActionTest { insertDefaultGroup(db.getDefaultOrganization(), "sonar-users", 0); loginAsDefaultOrgAdmin(); - assertThat(call(ws.newRequest()).getGroupsList()).extracting(Group::hasUuid, Group::hasName, Group::hasDescription, Group::hasMembersCount) + assertThat(call(ws.newRequest()).getGroupsList()).extracting(Group::hasId, Group::hasName, Group::hasDescription, Group::hasMembersCount) .containsOnly(tuple(true, true, true, true)); - assertThat(call(ws.newRequest().setParam(FIELDS, "")).getGroupsList()).extracting(Group::hasUuid, Group::hasName, Group::hasDescription, Group::hasMembersCount) + assertThat(call(ws.newRequest().setParam(FIELDS, "")).getGroupsList()).extracting(Group::hasId, Group::hasName, Group::hasDescription, Group::hasMembersCount) .containsOnly(tuple(true, true, true, true)); - assertThat(call(ws.newRequest().setParam(FIELDS, "name")).getGroupsList()).extracting(Group::hasUuid, Group::hasName, Group::hasDescription, Group::hasMembersCount) + assertThat(call(ws.newRequest().setParam(FIELDS, "name")).getGroupsList()).extracting(Group::hasId, Group::hasName, Group::hasDescription, Group::hasMembersCount) .containsOnly(tuple(true, true, false, false)); - assertThat(call(ws.newRequest().setParam(FIELDS, "description")).getGroupsList()).extracting(Group::hasUuid, Group::hasName, Group::hasDescription, Group::hasMembersCount) + assertThat(call(ws.newRequest().setParam(FIELDS, "description")).getGroupsList()).extracting(Group::hasId, Group::hasName, Group::hasDescription, Group::hasMembersCount) .containsOnly(tuple(true, false, true, false)); - assertThat(call(ws.newRequest().setParam(FIELDS, "membersCount")).getGroupsList()).extracting(Group::hasUuid, Group::hasName, Group::hasDescription, Group::hasMembersCount) + assertThat(call(ws.newRequest().setParam(FIELDS, "membersCount")).getGroupsList()).extracting(Group::hasId, Group::hasName, Group::hasDescription, Group::hasMembersCount) .containsOnly(tuple(true, false, false, true)); } @@ -188,7 +188,7 @@ public class SearchActionTest { SearchWsResponse response = call(ws.newRequest().setParam("organization", org.getKey())); - assertThat(response.getGroupsList()).extracting(Group::getUuid, Group::getName).containsOnly(tuple(group.getUuid(), "users")); + assertThat(response.getGroupsList()).extracting(Group::getId, Group::getName).containsOnly(tuple(group.getUuid(), "users")); } @Test |