diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-05-22 11:08:06 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-05-26 16:04:31 +0200 |
commit | 63efb0936a910d2051ae806bf60f80ba3497ab17 (patch) | |
tree | 3ae37b4d7c69e7c8071d250e9610bb2e9837f389 /sonar-core/src/test | |
parent | 478815189f2e78920ed22b5852259d347418246d (diff) | |
download | sonarqube-63efb0936a910d2051ae806bf60f80ba3497ab17.tar.gz sonarqube-63efb0936a910d2051ae806bf60f80ba3497ab17.zip |
SONAR-6465 Replace groupsCount by groups
Diffstat (limited to 'sonar-core/src/test')
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java | 15 |
1 files changed, 6 insertions, 9 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 570a7921777..ed86008d099 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 @@ -20,6 +20,7 @@ package org.sonar.core.user; +import com.google.common.collect.Multimap; import java.util.Arrays; import java.util.List; import org.junit.Before; @@ -192,15 +193,11 @@ public class GroupMembershipDaoTest { DbSession session = dbTester.myBatis().openSession(false); try { - assertThat(dao.countGroupsByLogins(session, Arrays.<String>asList())).isEmpty(); - assertThat(dao.countGroupsByLogins(session, Arrays.asList("two-hundred"))) - .containsExactly(entry("two-hundred", 3)); - assertThat(dao.countGroupsByLogins(session, Arrays.asList("two-hundred", "two-hundred-one"))) - .containsOnly(entry("two-hundred", 3), entry("two-hundred-one", 1)); - assertThat(dao.countGroupsByLogins(session, Arrays.asList("two-hundred", "two-hundred-one", "two-hundred-two"))) - .containsOnly(entry("two-hundred", 3), entry("two-hundred-one", 1), entry("two-hundred-two", 0)); - assertThat(dao.countGroupsByLogins(session, Arrays.asList("two-hundred-two"))) - .containsOnly(entry("two-hundred-two", 0)); + assertThat(dao.selectGroupsByLogins(session, Arrays.<String>asList()).keys()).isEmpty(); + Multimap<String, String> groupsByLogin = dao.selectGroupsByLogins(session, Arrays.asList("two-hundred", "two-hundred-one", "two-hundred-two")); + assertThat(groupsByLogin.get("two-hundred")).containsOnly("sonar-administrators", "sonar-users", "sonar-reviewers"); + assertThat(groupsByLogin.get("two-hundred-one")).containsOnly("sonar-users"); + assertThat(groupsByLogin.get("two-hundred-two")).isEmpty(); } finally { session.close(); } |