diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-26 11:26:50 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-26 11:26:58 +0200 |
commit | 08c2e6fd7e8a0d48b308ad13e1055dc82760617c (patch) | |
tree | 96f1f1cdeebde77d421aacaaf432e3e288f48685 /sonar-core/src/test | |
parent | 223299c1192266db9c4813faa37b5d10fba6f65f (diff) | |
download | sonarqube-08c2e6fd7e8a0d48b308ad13e1055dc82760617c.tar.gz sonarqube-08c2e6fd7e8a0d48b308ad13e1055dc82760617c.zip |
SONAR-4963 Return description in /permissions/search_groups
Diffstat (limited to 'sonar-core/src/test')
4 files changed, 13 insertions, 6 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDaoTest.java b/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDaoTest.java index b1e8c3a34d0..18b495e3e0a 100644 --- a/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDaoTest.java @@ -49,18 +49,22 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase { GroupWithPermissionDto anyone = result.get(0); assertThat(anyone.getName()).isEqualTo("Anyone"); + assertThat(anyone.getDescription()).isNull(); assertThat(anyone.getPermission()).isNotNull(); GroupWithPermissionDto group1 = result.get(1); assertThat(group1.getName()).isEqualTo("sonar-administrators"); + assertThat(group1.getDescription()).isEqualTo("System administrators"); assertThat(group1.getPermission()).isNotNull(); GroupWithPermissionDto group2 = result.get(2); assertThat(group2.getName()).isEqualTo("sonar-reviewers"); + assertThat(group2.getDescription()).isEqualTo("Reviewers"); assertThat(group2.getPermission()).isNull(); GroupWithPermissionDto group3 = result.get(3); assertThat(group3.getName()).isEqualTo("sonar-users"); + assertThat(group3.getDescription()).isEqualTo("Any new users created will automatically join this group"); assertThat(group3.getPermission()).isNotNull(); } diff --git a/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDtoTest.java b/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDtoTest.java index a86a99d79bb..b04c08b794b 100644 --- a/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDtoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDtoTest.java @@ -30,10 +30,12 @@ public class GroupWithPermissionDtoTest { public void to_group_with_permission_having_permission() throws Exception { GroupWithPermission group = new GroupWithPermissionDto() .setName("users") + .setDescription("desc") .setPermission("user") .toGroupWithPermission(); assertThat(group.name()).isEqualTo("users"); + assertThat(group.description()).isEqualTo("desc"); assertThat(group.hasPermission()).isTrue(); } @@ -45,6 +47,7 @@ public class GroupWithPermissionDtoTest { .toGroupWithPermission(); assertThat(group.name()).isEqualTo("users"); + assertThat(group.description()).isNull(); assertThat(group.hasPermission()).isFalse(); } } diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions.xml b/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions.xml index 820e566dbdf..418d5e69fac 100644 --- a/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions.xml +++ b/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions.xml @@ -1,8 +1,8 @@ <dataset> - <groups id="200" name="sonar-administrators"/> - <groups id="201" name="sonar-users" /> - <groups id="202" name="sonar-reviewers" /> + <groups id="200" name="sonar-administrators" description="System administrators"/> + <groups id="201" name="sonar-users" description="Any new users created will automatically join this group"/> + <groups id="202" name="sonar-reviewers" description="Reviewers"/> <!-- Project permissions --> <group_roles id="1" group_id="200" resource_id="100" role="user"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions_should_be_sorted_by_group_name.xml b/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions_should_be_sorted_by_group_name.xml index ba9d9acf297..10ab0e21e3f 100644 --- a/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions_should_be_sorted_by_group_name.xml +++ b/sonar-core/src/test/resources/org/sonar/core/permission/GroupWithPermissionDaoTest/groups_with_permissions_should_be_sorted_by_group_name.xml @@ -1,8 +1,8 @@ <dataset> - <groups id="200" name="sonar-reviewers" /> - <groups id="201" name="sonar-users" /> - <groups id="202" name="sonar-administrators"/> + <groups id="200" name="sonar-reviewers" description="Reviewers"/> + <groups id="201" name="sonar-users" description="Any new users created will automatically join this group"/> + <groups id="202" name="sonar-administrators" description="System administrators"/> <!-- Project permissions --> <group_roles id="1" group_id="200" resource_id="100" role="user"/> |