diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-05 15:21:25 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-05 15:21:34 +0200 |
commit | 42d098015ceadafb673aaf3f12c718c00e52b857 (patch) | |
tree | ed51d4aed555f21249c151636a53f3c35c123666 /sonar-core/src/test | |
parent | 100c7138734b67187175f38a0f85bebc71794087 (diff) | |
download | sonarqube-42d098015ceadafb673aaf3f12c718c00e52b857.tar.gz sonarqube-42d098015ceadafb673aaf3f12c718c00e52b857.zip |
SONAR-4963 Return group description in /user_groups/search
Diffstat (limited to 'sonar-core/src/test')
5 files changed, 12 insertions, 8 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java b/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java index 1a3dad7c2f3..03acafecc34 100644 --- a/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java @@ -57,6 +57,7 @@ public class GroupMembershipDaoTest extends AbstractDaoTestCase { GroupMembershipDto dto = result.get(0); assertThat(dto.getId()).isEqualTo(101L); assertThat(dto.getName()).isEqualTo("sonar-users"); + assertThat(dto.getDescription()).isEqualTo("Any new users created will automatically join this group"); assertThat(dto.getUserId()).isEqualTo(201L); } diff --git a/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDtoTest.java b/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDtoTest.java index bc145fb890a..38efb7ae25e 100644 --- a/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDtoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDtoTest.java @@ -31,11 +31,13 @@ public class GroupMembershipDtoTest { GroupMembership group = new GroupMembershipDto() .setId(1L) .setName("users") + .setDescription("description") .setUserId(10L) .toGroupMembership(); assertThat(group.id()).isEqualTo(1); assertThat(group.name()).isEqualTo("users"); + assertThat(group.description()).isEqualTo("description"); assertThat(group.isMember()).isTrue(); } @@ -44,11 +46,13 @@ public class GroupMembershipDtoTest { GroupMembership group = new GroupMembershipDto() .setId(1L) .setName("users") + .setDescription("description") .setUserId(null) .toGroupMembership(); assertThat(group.id()).isEqualTo(1); assertThat(group.name()).isEqualTo("users"); + assertThat(group.description()).isEqualTo("description"); assertThat(group.isMember()).isFalse(); } diff --git a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/select_user_group.xml b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/select_user_group.xml index 6d5fb36ece9..5993aae1121 100644 --- a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/select_user_group.xml +++ b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/select_user_group.xml @@ -1,6 +1,6 @@ <dataset> - <groups id="101" name="sonar-users" /> + <groups id="101" name="sonar-users" description="Any new users created will automatically join this group"/> <groups_users user_id="201" group_id="101"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/shared.xml index 3727413bdcd..f8ab9693a66 100644 --- a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/shared.xml @@ -1,8 +1,8 @@ <dataset> - <groups id="100" name="sonar-administrators"/> - <groups id="101" name="sonar-users" /> - <groups id="102" name="sonar-reviewers" /> + <groups id="100" name="sonar-administrators" description="System administrators"/> + <groups id="101" name="sonar-users" description="Any new users created will automatically join this group"/> + <groups id="102" name="sonar-reviewers" description="Reviewers"/> <!-- user 200 is in all groups --> <groups_users user_id="200" group_id="100"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/should_be_sorted_by_group_name.xml b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/should_be_sorted_by_group_name.xml index 35a02d7ce46..baaecdb40d4 100644 --- a/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/should_be_sorted_by_group_name.xml +++ b/sonar-core/src/test/resources/org/sonar/core/user/GroupMembershipDaoTest/should_be_sorted_by_group_name.xml @@ -1,13 +1,12 @@ <dataset> - <groups id="100" name="sonar-users" /> - <groups id="101" name="sonar-administrators"/> - <groups id="102" name="sonar-reviewers" /> + <groups id="100" name="sonar-users" description="Any new users created will automatically join this group"/> + <groups id="101" name="sonar-administrators" description="System administrators"/>/> + <groups id="102" name="sonar-reviewers" description="Reviewers"/> <!-- user 200 is in all groups --> <groups_users user_id="200" group_id="100"/> <groups_users user_id="200" group_id="101"/> <groups_users user_id="200" group_id="102"/> - </dataset> |