diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-07-23 11:09:35 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-07-23 11:09:45 +0200 |
commit | 61cde2b2b9685a17b4519e67cd056fd3f6430b77 (patch) | |
tree | 1e25b8ba3610dcce98941ed4f6afc882ae5751da | |
parent | d8e2d42e70807608e015381b55d2431db73bc574 (diff) | |
download | sonarqube-61cde2b2b9685a17b4519e67cd056fd3f6430b77.tar.gz sonarqube-61cde2b2b9685a17b4519e67cd056fd3f6430b77.zip |
Move UserDao to sonar-db
28 files changed, 195 insertions, 295 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/DbClient.java b/server/sonar-server/src/main/java/org/sonar/server/db/DbClient.java index 684a0fb426b..a79e3056a01 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/DbClient.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/DbClient.java @@ -25,7 +25,6 @@ import org.sonar.db.Database; import org.sonar.db.MyBatis; import org.sonar.server.qualityprofile.db.ActiveRuleDao; import org.sonar.server.rule.db.RuleDao; -import org.sonar.server.user.db.UserDao; /** * Should be replaced by {@link org.sonar.db.DbClient}, but some DAOs @@ -35,7 +34,6 @@ public class DbClient extends org.sonar.db.DbClient { private ActiveRuleDao activeRuleDao; private RuleDao ruleDao; - private UserDao userDao; public DbClient(Database database, MyBatis myBatis, Dao... daos) { super(database, myBatis, daos); @@ -45,7 +43,6 @@ public class DbClient extends org.sonar.db.DbClient { protected void doOnLoad(Map<Class, Dao> daoByClass) { this.activeRuleDao = (ActiveRuleDao) daoByClass.get(ActiveRuleDao.class); this.ruleDao = (RuleDao) daoByClass.get(RuleDao.class); - this.userDao = (UserDao) daoByClass.get(UserDao.class); } public ActiveRuleDao activeRuleDao() { @@ -55,8 +52,4 @@ public class DbClient extends org.sonar.db.DbClient { public RuleDao ruleDao() { return ruleDao; } - - public UserDao userDao() { - return userDao; - } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java index 71409b9efa1..459386824a7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java @@ -29,7 +29,6 @@ import org.sonar.db.DaoUtils; import org.sonar.db.DatabaseChecker; import org.sonar.db.DefaultDatabase; import org.sonar.db.MyBatis; -import org.sonar.db.measure.custom.CustomMeasureDao; import org.sonar.db.purge.PurgeProfiler; import org.sonar.db.semaphore.SemaphoresImpl; import org.sonar.db.version.DatabaseVersion; @@ -37,7 +36,6 @@ import org.sonar.db.version.MigrationStepModule; import org.sonar.server.db.DbClient; import org.sonar.server.db.EmbeddedDatabaseFactory; import org.sonar.server.issue.index.IssueIndex; -import org.sonar.db.metric.MetricDao; import org.sonar.server.platform.DatabaseServerCompatibility; import org.sonar.server.platform.DefaultServerFileSystem; import org.sonar.server.platform.Platform; @@ -54,8 +52,6 @@ import org.sonar.server.rule.index.RuleNormalizer; import org.sonar.server.search.EsSearchModule; import org.sonar.server.search.IndexQueue; import org.sonar.server.user.ThreadLocalUserSession; -import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; public class PlatformLevel1 extends PlatformLevel { private final Platform platform; @@ -105,12 +101,8 @@ public class PlatformLevel1 extends PlatformLevel { EsSearchModule.class, // DAOs to be moved to sonar-db - GroupDao.class, - UserDao.class, RuleDao.class, ActiveRuleDao.class, - MetricDao.class, - CustomMeasureDao.class, // rules/qprofiles RuleNormalizer.class, diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/UserUpdater.java b/server/sonar-server/src/main/java/org/sonar/server/user/UserUpdater.java index f9981911ad5..1bca7a4828d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/user/UserUpdater.java +++ b/server/sonar-server/src/main/java/org/sonar/server/user/UserUpdater.java @@ -45,6 +45,7 @@ import org.sonar.db.user.UserGroupDto; import org.sonar.server.db.DbClient; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.Message; +import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.ServerException; import org.sonar.server.user.index.UserIndexer; import org.sonar.server.util.Validation; @@ -118,7 +119,10 @@ public class UserUpdater { public void update(UpdateUser updateUser) { DbSession dbSession = dbClient.openSession(false); try { - UserDto user = dbClient.userDao().selectByLogin(dbSession, updateUser.login()); + UserDto user = dbClient.userDao().selectNullableByLogin(dbSession, updateUser.login()); + if (user == null) { + throw new NotFoundException(String.format("User with login '%s' has not been found", updateUser.login())); + } updateUserDto(dbSession, updateUser, user); updateUser(dbSession, user); dbSession.commit(); @@ -267,7 +271,7 @@ public class UserUpdater { } private void validateScmAccounts(DbSession dbSession, List<String> scmAccounts, @Nullable String login, @Nullable String email, @Nullable UserDto existingUser, - List<Message> messages) { + List<Message> messages) { for (String scmAccount : scmAccounts) { if (scmAccount.equals(login) || scmAccount.equals(email)) { messages.add(Message.of("user.login_or_email_used_as_scm_account")); diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/db/UserDao.java b/server/sonar-server/src/main/java/org/sonar/server/user/db/UserDao.java deleted file mode 100644 index e11986ab029..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/user/db/UserDao.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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.user.db; - -import java.util.List; -import javax.annotation.CheckForNull; -import org.sonar.api.utils.System2; -import org.sonar.db.Dao; -import org.sonar.db.DbSession; -import org.sonar.db.MyBatis; -import org.sonar.db.user.UserDto; -import org.sonar.db.user.UserMapper; -import org.sonar.server.exceptions.NotFoundException; - -public class UserDao extends org.sonar.db.user.UserDao implements Dao { - - public UserDao(MyBatis mybatis, System2 system2) { - super(mybatis, system2); - } - - @CheckForNull - public UserDto selectNullableByLogin(DbSession session, String login) { - return mapper(session).selectByLogin(login); - } - - public UserDto selectByLogin(DbSession session, String login) { - UserDto user = selectNullableByLogin(session, login); - if (user == null) { - throw new NotFoundException(String.format("User with login '%s' has not been found", login)); - } - return user; - } - - public List<UserDto> selectNullableByScmAccountOrLoginOrEmail(DbSession session, String scmAccountOrLoginOrEmail) { - String like = new StringBuilder().append("%") - .append(UserDto.SCM_ACCOUNTS_SEPARATOR).append(scmAccountOrLoginOrEmail) - .append(UserDto.SCM_ACCOUNTS_SEPARATOR).append("%").toString(); - return mapper(session).selectNullableByScmAccountOrLoginOrEmail(scmAccountOrLoginOrEmail, like); - } - - protected UserMapper mapper(DbSession session) { - return session.getMapper(UserMapper.class); - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/db/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/user/db/package-info.java deleted file mode 100644 index 51f61540320..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/user/db/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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. - */ - -@ParametersAreNonnullByDefault -package org.sonar.server.user.db; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java b/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java index 889878cd589..cfa985a563b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java @@ -34,6 +34,7 @@ import org.sonar.db.user.GroupMembershipDto; import org.sonar.db.user.GroupMembershipQuery; import org.sonar.db.user.UserDto; import org.sonar.server.db.DbClient; +import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.UserSession; public class GroupsAction implements UsersWsAction { @@ -93,7 +94,10 @@ public class GroupsAction implements UsersWsAction { DbSession session = dbClient.openSession(false); try { - UserDto user = dbClient.userDao().selectByLogin(session, login); + UserDto user = dbClient.userDao().selectNullableByLogin(session, login); + if (user == null) { + throw new NotFoundException(String.format("User with login '%s' has not been found", login)); + } int total = dbClient.groupMembershipDao().countGroups(session, query, user.getId()); Paging paging = Paging.create(pageSize, page, total); List<GroupMembershipDto> groups = dbClient.groupMembershipDao().selectGroups(session, query, user.getId(), paging.offset(), pageSize); diff --git a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/RemoveUserAction.java b/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/RemoveUserAction.java index a49e68db21a..ebde38ba567 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/RemoveUserAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/RemoveUserAction.java @@ -75,7 +75,10 @@ public class RemoveUserAction implements UserGroupsWsAction { DbSession dbSession = dbClient.openSession(false); try { - GroupDto group = dbClient.groupDao().selectById(dbSession, groupId); + GroupDto group = dbClient.groupDao().selectNullableById(dbSession, groupId); + if (group == null) { + throw new NotFoundException(String.format("Could not find a user group with id '%s'", groupId)); + } UserDto user = dbClient.userDao().selectActiveUserByLogin(dbSession, login); if (user == null) { throw new NotFoundException(String.format("Could not find a user with login '%s'", login)); diff --git a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/UpdateAction.java b/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/UpdateAction.java index c8ba948b205..b253311eaf4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/UpdateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/UpdateAction.java @@ -29,6 +29,7 @@ import org.sonar.core.permission.GlobalPermissions; import org.sonar.db.DbSession; import org.sonar.db.user.GroupDto; import org.sonar.server.db.DbClient; +import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.UserSession; import static org.sonar.db.MyBatis.closeQuietly; @@ -85,7 +86,10 @@ public class UpdateAction implements UserGroupsWsAction { DbSession dbSession = dbClient.openSession(false); try { groupUpdater.checkNameIsUnique(name, dbSession); - GroupDto group = dbClient.groupDao().selectById(dbSession, groupId); + GroupDto group = dbClient.groupDao().selectNullableById(dbSession, groupId); + if (group == null) { + throw new NotFoundException(String.format("Could not find a user group with id '%s'.", groupId)); + } if (name != null) { groupUpdater.validateName(name); group.setName(name); diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java index 1907f05f029..1f20960febc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java @@ -54,7 +54,7 @@ import org.sonar.server.qualityprofile.ActiveRuleChange.Type; import org.sonar.server.qualityprofile.QProfileFactory; import org.sonar.server.qualityprofile.QProfileTesting; import org.sonar.server.rule.db.RuleDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java index 15e83750d55..a254c97e6a7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java @@ -42,7 +42,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.qualityprofile.QProfileTesting; import org.sonar.server.tester.UserSessionRule; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import org.sonar.server.ws.WsTester.TestRequest; import org.sonar.test.DbTests; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java index 342b924e6f9..8b3b7de7a48 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java @@ -43,7 +43,7 @@ import org.sonar.db.user.UserDto; import org.sonar.server.db.DbClient; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ui.Views; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import static org.mockito.Mockito.mock; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java index 24d7a6f3e2d..44296c3a607 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java @@ -47,7 +47,7 @@ import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.Message; import org.sonar.server.exceptions.ServerException; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; import org.sonar.server.util.Validation; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java deleted file mode 100644 index 6b6b638e2a7..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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.user.db; - -import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.sonar.api.utils.System2; -import org.sonar.db.DbSession; -import org.sonar.db.DbTester; -import org.sonar.db.user.UserDto; -import org.sonar.server.exceptions.NotFoundException; -import org.sonar.test.DbTests; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.mock; - -@Category(DbTests.class) -public class UserDaoTest { - - @Rule - public DbTester db = DbTester.create(System2.INSTANCE); - - private UserDao dao; - private DbSession session; - - @Before - public void before() { - db.truncateTables(); - - this.session = db.myBatis().openSession(false); - System2 system2 = mock(System2.class); - this.dao = new UserDao(db.myBatis(), system2); - } - - @After - public void after() { - this.session.close(); - } - - @Test - public void select_by_login() { - db.prepareDbUnit(getClass(), "select_by_login.xml"); - - UserDto dto = dao.selectByLogin(session, "marius"); - assertThat(dto.getId()).isEqualTo(101); - assertThat(dto.getLogin()).isEqualTo("marius"); - assertThat(dto.getName()).isEqualTo("Marius"); - assertThat(dto.getEmail()).isEqualTo("marius@lesbronzes.fr"); - assertThat(dto.isActive()).isTrue(); - assertThat(dto.getScmAccountsAsList()).containsOnly("ma","marius33"); - assertThat(dto.getSalt()).isEqualTo("79bd6a8e79fb8c76ac8b121cc7e8e11ad1af8365"); - assertThat(dto.getCryptedPassword()).isEqualTo("650d2261c98361e2f67f90ce5c65a95e7d8ea2fg"); - assertThat(dto.getCreatedAt()).isEqualTo(1418215735482L); - assertThat(dto.getUpdatedAt()).isEqualTo(1418215735485L); - } - - @Test - public void select_nullable_by_scm_account() { - db.prepareDbUnit(getClass(), "select_nullable_by_scm_account.xml"); - - List<UserDto> results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "ma"); - assertThat(results).hasSize(1); - assertThat(results.get(0).getLogin()).isEqualTo("marius"); - - results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "marius"); - assertThat(results).hasSize(1); - assertThat(results.get(0).getLogin()).isEqualTo("marius"); - - results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); - assertThat(results).hasSize(1); - assertThat(results.get(0).getLogin()).isEqualTo("marius"); - - results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); - assertThat(results).hasSize(1); - assertThat(results.get(0).getLogin()).isEqualTo("marius"); - - results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "m"); - assertThat(results).isEmpty(); - - results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "unknown"); - assertThat(results).isEmpty(); - } - - @Test - public void select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users() { - db.prepareDbUnit(getClass(), "select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml"); - - List<UserDto> results = dao.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); - assertThat(results).hasSize(2); - } - - @Test - public void select_by_login_with_unknown_login() { - try { - dao.selectByLogin(session, "unknown"); - fail(); - } catch (Exception e) { - assertThat(e).isInstanceOf(NotFoundException.class).hasMessage("User with login 'unknown' has not been found"); - } - } - - @Test - public void select_nullable_by_login() { - db.prepareDbUnit(getClass(), "select_by_login.xml"); - - assertThat(dao.selectNullableByLogin(session, "marius")).isNotNull(); - - assertThat(dao.selectNullableByLogin(session, "unknown")).isNull(); - } - -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java index b8831db855d..7adda5b93cc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java @@ -44,7 +44,7 @@ import org.sonar.server.user.NewUserNotifier; import org.sonar.server.user.SecurityRealmFactory; import org.sonar.server.user.UserUpdater; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java index ec7db596fc4..77fa6c2169b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java @@ -45,7 +45,7 @@ import org.sonar.server.user.NewUserNotifier; import org.sonar.server.user.SecurityRealmFactory; import org.sonar.server.user.UserUpdater; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java index 2939ce81f9d..12fcc9b7230 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java @@ -44,7 +44,7 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.user.NewUserNotifier; import org.sonar.server.user.SecurityRealmFactory; import org.sonar.server.user.UserUpdater; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/GroupsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/GroupsActionTest.java index 5d0c01c2bd1..daeae45b426 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/GroupsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/GroupsActionTest.java @@ -40,7 +40,7 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; public class GroupsActionTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java index ad6fad60cd0..e36fae31715 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java @@ -45,7 +45,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.es.EsTester; import org.sonar.server.tester.UserSessionRule; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java index 2e765fc05cb..b260bff8dc1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java @@ -43,7 +43,7 @@ import org.sonar.server.user.NewUserNotifier; import org.sonar.server.user.SecurityRealmFactory; import org.sonar.server.user.UserUpdater; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java index fb36a088a89..f6b27e377f3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java @@ -42,7 +42,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import org.sonar.test.DbTests; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java index a18dd2fc392..5eb47729cef 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java @@ -41,7 +41,7 @@ import org.sonar.server.db.DbClient; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import org.sonar.test.DbTests; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java index e992c2cd9b4..f58bcfe0eed 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java @@ -41,7 +41,7 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.db.user.GroupDao; -import org.sonar.server.user.db.UserDao; +import org.sonar.db.user.UserDao; import org.sonar.server.ws.WsTester; import org.sonar.server.ws.WsTester.TestRequest; import org.sonar.test.DbTests; diff --git a/sonar-db/src/main/java/org/sonar/db/DaoUtils.java b/sonar-db/src/main/java/org/sonar/db/DaoUtils.java index d2b0304f0a7..e0f02da0fa3 100644 --- a/sonar-db/src/main/java/org/sonar/db/DaoUtils.java +++ b/sonar-db/src/main/java/org/sonar/db/DaoUtils.java @@ -45,6 +45,8 @@ import org.sonar.db.issue.IssueFilterFavouriteDao; import org.sonar.db.loadedtemplate.LoadedTemplateDao; import org.sonar.db.measure.MeasureDao; import org.sonar.db.measure.MeasureFilterDao; +import org.sonar.db.measure.custom.CustomMeasureDao; +import org.sonar.db.metric.MetricDao; import org.sonar.db.notification.NotificationQueueDao; import org.sonar.db.permission.PermissionDao; import org.sonar.db.permission.PermissionTemplateDao; @@ -57,6 +59,7 @@ import org.sonar.db.qualityprofile.QualityProfileDao; import org.sonar.db.source.FileSourceDao; import org.sonar.db.user.AuthorDao; import org.sonar.db.user.AuthorizationDao; +import org.sonar.db.user.GroupDao; import org.sonar.db.user.GroupMembershipDao; import org.sonar.db.user.RoleDao; import org.sonar.db.user.UserDao; @@ -79,10 +82,12 @@ public final class DaoUtils { AuthorizationDao.class, ComponentDao.class, ComponentLinkDao.class, + CustomMeasureDao.class, DashboardDao.class, DuplicationDao.class, EventDao.class, FileSourceDao.class, + GroupDao.class, GroupMembershipDao.class, IssueDao.class, IssueChangeDao.class, @@ -91,6 +96,7 @@ public final class DaoUtils { LoadedTemplateDao.class, MeasureDao.class, MeasureFilterDao.class, + MetricDao.class, NotificationQueueDao.class, PermissionDao.class, PermissionTemplateDao.class, diff --git a/sonar-db/src/main/java/org/sonar/db/user/UserDao.java b/sonar-db/src/main/java/org/sonar/db/user/UserDao.java index 985da344a29..4d220bf8a87 100644 --- a/sonar-db/src/main/java/org/sonar/db/user/UserDao.java +++ b/sonar-db/src/main/java/org/sonar/db/user/UserDao.java @@ -28,6 +28,7 @@ import org.sonar.api.utils.System2; import org.sonar.db.Dao; import org.sonar.db.DbSession; import org.sonar.db.MyBatis; +import org.sonar.db.util.RowNotFoundException; public class UserDao implements Dao { @@ -172,4 +173,28 @@ public class UserDao implements Dao { MyBatis.closeQuietly(session); } } + + @CheckForNull + public UserDto selectNullableByLogin(DbSession session, String login) { + return mapper(session).selectByLogin(login); + } + + public UserDto selectByLogin(DbSession session, String login) { + UserDto user = selectNullableByLogin(session, login); + if (user == null) { + throw new RowNotFoundException(String.format("User with login '%s' has not been found", login)); + } + return user; + } + + public List<UserDto> selectNullableByScmAccountOrLoginOrEmail(DbSession session, String scmAccountOrLoginOrEmail) { + String like = new StringBuilder().append("%") + .append(UserDto.SCM_ACCOUNTS_SEPARATOR).append(scmAccountOrLoginOrEmail) + .append(UserDto.SCM_ACCOUNTS_SEPARATOR).append("%").toString(); + return mapper(session).selectNullableByScmAccountOrLoginOrEmail(scmAccountOrLoginOrEmail, like); + } + + protected UserMapper mapper(DbSession session) { + return session.getMapper(UserMapper.class); + } } diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java index 5bcb390ae96..f1f366f6446 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java @@ -23,16 +23,21 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; +import org.junit.After; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.sonar.api.user.UserQuery; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; +import org.sonar.db.DbSession; import org.sonar.db.DbTester; +import org.sonar.db.util.RowNotFoundException; import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -42,112 +47,125 @@ public class UserDaoTest { System2 system2 = mock(System2.class); @Rule - public DbTester dbTester = DbTester.create(system2); + public DbTester db = DbTester.create(system2); - UserDao dao = dbTester.getDbClient().userDao(); + UserDao underTest = db.getDbClient().userDao(); + DbSession session; + + @Before + public void before() { + db.truncateTables(); + + this.session = db.getSession(); + } + + @After + public void after() { + this.session.close(); + } @Test public void selectUserByLogin_ignore_inactive() { - dbTester.prepareDbUnit(getClass(), "selectActiveUserByLogin.xml"); + db.prepareDbUnit(getClass(), "selectActiveUserByLogin.xml"); - UserDto user = dao.getUser(50); + UserDto user = underTest.getUser(50); assertThat(user.getLogin()).isEqualTo("inactive_user"); - user = dao.selectActiveUserByLogin("inactive_user"); + user = underTest.selectActiveUserByLogin("inactive_user"); assertThat(user).isNull(); } @Test public void selectUserByLogin_not_found() { - dbTester.prepareDbUnit(getClass(), "selectActiveUserByLogin.xml"); + db.prepareDbUnit(getClass(), "selectActiveUserByLogin.xml"); - UserDto user = dao.selectActiveUserByLogin("not_found"); + UserDto user = underTest.selectActiveUserByLogin("not_found"); assertThat(user).isNull(); } @Test public void selectUsersByLogins() { - dbTester.prepareDbUnit(getClass(), "selectUsersByLogins.xml"); + db.prepareDbUnit(getClass(), "selectUsersByLogins.xml"); - Collection<UserDto> users = dao.selectUsersByLogins(Arrays.asList("marius", "inactive_user", "other")); + Collection<UserDto> users = underTest.selectUsersByLogins(Arrays.asList("marius", "inactive_user", "other")); assertThat(users).hasSize(2); assertThat(users).extracting("login").containsOnly("marius", "inactive_user"); } @Test public void selectUsersByLogins_empty_logins() { - dbTester.truncateTables(); + db.truncateTables(); // no need to access db - Collection<UserDto> users = dao.selectUsersByLogins(Collections.<String>emptyList()); + Collection<UserDto> users = underTest.selectUsersByLogins(Collections.<String>emptyList()); assertThat(users).isEmpty(); } @Test public void selectUsersByQuery_all() { - dbTester.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); + db.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); UserQuery query = UserQuery.builder().includeDeactivated().build(); - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).hasSize(2); } @Test public void selectUsersByQuery_only_actives() { - dbTester.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); + db.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); UserQuery query = UserQuery.ALL_ACTIVES; - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).hasSize(1); assertThat(users.get(0).getName()).isEqualTo("Marius"); } @Test public void selectUsersByQuery_filter_by_login() { - dbTester.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); + db.prepareDbUnit(getClass(), "selectUsersByQuery.xml"); UserQuery query = UserQuery.builder().logins("marius", "john").build(); - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).hasSize(1); assertThat(users.get(0).getName()).isEqualTo("Marius"); } @Test public void selectUsersByQuery_search_by_login_text() { - dbTester.prepareDbUnit(getClass(), "selectUsersByText.xml"); + db.prepareDbUnit(getClass(), "selectUsersByText.xml"); UserQuery query = UserQuery.builder().searchText("sbr").build(); - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).hasSize(1); assertThat(users.get(0).getLogin()).isEqualTo("sbrandhof"); } @Test public void selectUsersByQuery_search_by_name_text() { - dbTester.prepareDbUnit(getClass(), "selectUsersByText.xml"); + db.prepareDbUnit(getClass(), "selectUsersByText.xml"); UserQuery query = UserQuery.builder().searchText("Simon").build(); - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).hasSize(1); assertThat(users.get(0).getLogin()).isEqualTo("sbrandhof"); } @Test public void selectUsersByQuery_escape_special_characters_in_like() { - dbTester.prepareDbUnit(getClass(), "selectUsersByText.xml"); + db.prepareDbUnit(getClass(), "selectUsersByText.xml"); UserQuery query = UserQuery.builder().searchText("%s%").build(); // we expect really a login or name containing the 3 characters "%s%" - List<UserDto> users = dao.selectUsers(query); + List<UserDto> users = underTest.selectUsers(query); assertThat(users).isEmpty(); } @Test public void selectGroupByName() { - dbTester.prepareDbUnit(getClass(), "selectGroupByName.xml"); + db.prepareDbUnit(getClass(), "selectGroupByName.xml"); - GroupDto group = dao.selectGroupByName("sonar-users"); + GroupDto group = underTest.selectGroupByName("sonar-users"); assertThat(group).isNotNull(); assertThat(group.getId()).isEqualTo(1L); assertThat(group.getName()).isEqualTo("sonar-users"); @@ -158,9 +176,9 @@ public class UserDaoTest { @Test public void selectGroupByName_not_found() { - dbTester.prepareDbUnit(getClass(), "selectGroupByName.xml"); + db.prepareDbUnit(getClass(), "selectGroupByName.xml"); - GroupDto group = dao.selectGroupByName("not-found"); + GroupDto group = underTest.selectGroupByName("not-found"); assertThat(group).isNull(); } @@ -179,10 +197,10 @@ public class UserDaoTest { .setCryptedPassword("abcd") .setCreatedAt(date) .setUpdatedAt(date); - dao.insert(dbTester.getSession(), userDto); - dbTester.getSession().commit(); + underTest.insert(db.getSession(), userDto); + db.getSession().commit(); - UserDto user = dao.selectActiveUserByLogin("john"); + UserDto user = underTest.selectActiveUserByLogin("john"); assertThat(user).isNotNull(); assertThat(user.getId()).isNotNull(); assertThat(user.getLogin()).isEqualTo("john"); @@ -198,7 +216,7 @@ public class UserDaoTest { @Test public void update_user() { - dbTester.prepareDbUnit(getClass(), "update_user.xml"); + db.prepareDbUnit(getClass(), "update_user.xml"); Long date = DateUtils.parseDate("2014-06-21").getTime(); @@ -212,10 +230,10 @@ public class UserDaoTest { .setSalt("12345") .setCryptedPassword("abcde") .setUpdatedAt(date); - dao.update(dbTester.getSession(), userDto); - dbTester.getSession().commit(); + underTest.update(db.getSession(), userDto); + db.getSession().commit(); - UserDto user = dao.getUser(1); + UserDto user = underTest.getUser(1); assertThat(user).isNotNull(); assertThat(user.getId()).isEqualTo(1L); assertThat(user.getLogin()).isEqualTo("john"); @@ -231,21 +249,21 @@ public class UserDaoTest { @Test public void deactivate_user() { - dbTester.prepareDbUnit(getClass(), "deactivate_user.xml"); + db.prepareDbUnit(getClass(), "deactivate_user.xml"); when(system2.now()).thenReturn(1500000000000L); String login = "marius"; - boolean deactivated = dao.deactivateUserByLogin(login); + boolean deactivated = underTest.deactivateUserByLogin(login); assertThat(deactivated).isTrue(); - assertThat(dao.selectActiveUserByLogin(login)).isNull(); + assertThat(underTest.selectActiveUserByLogin(login)).isNull(); - UserDto userDto = dao.getUser(100); + UserDto userDto = underTest.getUser(100); assertThat(userDto.isActive()).isFalse(); assertThat(userDto.getUpdatedAt()).isEqualTo(1500000000000L); - dbTester.assertDbUnit(getClass(), "deactivate_user-result.xml", + db.assertDbUnit(getClass(), "deactivate_user-result.xml", "dashboards", "active_dashboards", "groups_users", "issue_filters", "issue_filter_favourites", "measure_filters", "measure_filter_favourites", "properties", "user_roles"); @@ -253,11 +271,82 @@ public class UserDaoTest { @Test public void deactivate_missing_user() { - dbTester.prepareDbUnit(getClass(), "deactivate_user.xml"); + db.prepareDbUnit(getClass(), "deactivate_user.xml"); String login = "does_not_exist"; - boolean deactivated = dao.deactivateUserByLogin(login); + boolean deactivated = underTest.deactivateUserByLogin(login); assertThat(deactivated).isFalse(); - assertThat(dao.selectActiveUserByLogin(login)).isNull(); + assertThat(underTest.selectActiveUserByLogin(login)).isNull(); + } + + @Test + public void select_by_login() { + db.prepareDbUnit(getClass(), "select_by_login.xml"); + + UserDto dto = underTest.selectByLogin(session, "marius"); + assertThat(dto.getId()).isEqualTo(101); + assertThat(dto.getLogin()).isEqualTo("marius"); + assertThat(dto.getName()).isEqualTo("Marius"); + assertThat(dto.getEmail()).isEqualTo("marius@lesbronzes.fr"); + assertThat(dto.isActive()).isTrue(); + assertThat(dto.getScmAccountsAsList()).containsOnly("ma", "marius33"); + assertThat(dto.getSalt()).isEqualTo("79bd6a8e79fb8c76ac8b121cc7e8e11ad1af8365"); + assertThat(dto.getCryptedPassword()).isEqualTo("650d2261c98361e2f67f90ce5c65a95e7d8ea2fg"); + assertThat(dto.getCreatedAt()).isEqualTo(1418215735482L); + assertThat(dto.getUpdatedAt()).isEqualTo(1418215735485L); + } + + @Test + public void select_nullable_by_scm_account() { + db.prepareDbUnit(getClass(), "select_nullable_by_scm_account.xml"); + + List<UserDto> results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "ma"); + assertThat(results).hasSize(1); + assertThat(results.get(0).getLogin()).isEqualTo("marius"); + + results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "marius"); + assertThat(results).hasSize(1); + assertThat(results.get(0).getLogin()).isEqualTo("marius"); + + results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); + assertThat(results).hasSize(1); + assertThat(results.get(0).getLogin()).isEqualTo("marius"); + + results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); + assertThat(results).hasSize(1); + assertThat(results.get(0).getLogin()).isEqualTo("marius"); + + results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "m"); + assertThat(results).isEmpty(); + + results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "unknown"); + assertThat(results).isEmpty(); + } + + @Test + public void select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users() { + db.prepareDbUnit(getClass(), "select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml"); + + List<UserDto> results = underTest.selectNullableByScmAccountOrLoginOrEmail(session, "marius@lesbronzes.fr"); + assertThat(results).hasSize(2); + } + + @Test + public void select_by_login_with_unknown_login() { + try { + underTest.selectByLogin(session, "unknown"); + fail(); + } catch (Exception e) { + assertThat(e).isInstanceOf(RowNotFoundException.class).hasMessage("User with login 'unknown' has not been found"); + } + } + + @Test + public void select_nullable_by_login() { + db.prepareDbUnit(getClass(), "select_by_login.xml"); + + assertThat(underTest.selectNullableByLogin(session, "marius")).isNotNull(); + + assertThat(underTest.selectNullableByLogin(session, "unknown")).isNull(); } } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_by_login.xml b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_by_login.xml index 5a54ec22958..5a54ec22958 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_by_login.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_by_login.xml diff --git a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_nullable_by_scm_account.xml b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_nullable_by_scm_account.xml index 1a5f244b365..1a5f244b365 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_nullable_by_scm_account.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_nullable_by_scm_account.xml diff --git a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml index 41fe9478740..41fe9478740 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/user/db/UserDaoTest/select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/UserDaoTest/select_nullable_by_scm_account_return_many_results_when_same_email_is_used_by_many_users.xml |