diff options
author | Pierre Guillot <pierre.guillot@sonarsource.com> | 2020-02-06 14:17:31 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2020-02-20 20:46:16 +0100 |
commit | 333a03b9c402c06b90790209f20e1999e664d5bb (patch) | |
tree | ede9dc3ae1a0125f9e9731618878bdd6774a1d0d /server/sonar-db-dao | |
parent | 86ed2e5290ec4692bb9a23201658d723193d25dc (diff) | |
download | sonarqube-333a03b9c402c06b90790209f20e1999e664d5bb.tar.gz sonarqube-333a03b9c402c06b90790209f20e1999e664d5bb.zip |
cleanup unused sonarcloud code
Diffstat (limited to 'server/sonar-db-dao')
4 files changed, 0 insertions, 43 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java index f8b1b12be31..6f93b86fade 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java @@ -136,10 +136,6 @@ public class UserDao implements Dao { mapper(dbSession).deactivateUser(user.getLogin(), system2.now()); } - public void deactivateSonarCloudUser(DbSession dbSession, UserDto user) { - mapper(dbSession).deactivateSonarCloudUser(user.getLogin(), system2.now()); - } - public void cleanHomepage(DbSession dbSession, OrganizationDto organization) { mapper(dbSession).clearHomepages("ORGANIZATION", organization.getUuid(), system2.now()); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserMapper.java index d2a37a2b817..16e197b67ea 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserMapper.java @@ -82,8 +82,6 @@ public interface UserMapper { void deactivateUser(@Param("login") String login, @Param("now") long now); - void deactivateSonarCloudUser(@Param("login") String login, @Param("now") long now); - void clearHomepages(@Param("homepageType") String type, @Param("homepageParameter") String value, @Param("now") long now); void clearHomepage(@Param("login") String login, @Param("now") long now); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/user/UserMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/user/UserMapper.xml index d6c6c9b059f..82fd6784cda 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/user/UserMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/user/UserMapper.xml @@ -189,14 +189,6 @@ login = #{login, jdbcType=VARCHAR} </update> - <update id="deactivateSonarCloudUser" parameterType="map"> - update users set - name = null, - <include refid="deactivateUserUpdatedFields"/> - where - login = #{login, jdbcType=VARCHAR} - </update> - <update id="clearHomepages" parameterType="map"> update users set homepage_type = null, diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java index 08eb943f58f..4dd8cbd122c 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java @@ -458,35 +458,6 @@ public class UserDaoTest { } @Test - public void deactivate_sonarcloud_user() { - UserDto user = insertActiveUser(); - insertUserGroup(user); - UserDto otherUser = insertActiveUser(); - underTest.update(db.getSession(), user.setLastConnectionDate(10_000_000_000L)); - session.commit(); - - underTest.deactivateSonarCloudUser(session, user); - - UserDto userReloaded = underTest.selectUserById(session, user.getId()); - assertThat(userReloaded.isActive()).isFalse(); - assertThat(userReloaded.getName()).isNull(); - assertThat(userReloaded.getLogin()).isEqualTo(user.getLogin()); - assertThat(userReloaded.getExternalId()).isEqualTo(user.getExternalId()); - assertThat(userReloaded.getExternalLogin()).isEqualTo(user.getExternalLogin()); - assertThat(userReloaded.getExternalIdentityProvider()).isEqualTo(user.getExternalIdentityProvider()); - assertThat(userReloaded.getEmail()).isNull(); - assertThat(userReloaded.getScmAccounts()).isNull(); - assertThat(userReloaded.getSalt()).isNull(); - assertThat(userReloaded.getCryptedPassword()).isNull(); - assertThat(userReloaded.isRoot()).isFalse(); - assertThat(userReloaded.getUpdatedAt()).isEqualTo(NOW); - assertThat(userReloaded.getHomepageType()).isNull(); - assertThat(userReloaded.getHomepageParameter()).isNull(); - assertThat(userReloaded.getLastConnectionDate()).isNull(); - assertThat(underTest.selectUserById(session, otherUser.getId())).isNotNull(); - } - - @Test public void clean_users_homepage_when_deleting_organization() { UserDto userUnderTest = newUserDto().setHomepageType("ORGANIZATION").setHomepageParameter("dummy-organization-UUID"); |