aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2019-08-12 12:00:07 +0200
committerSonarTech <sonartech@sonarsource.com>2019-08-14 20:21:14 +0200
commit3a3948b47bcb86fe0bb7c427397303f54bfaa0ed (patch)
tree59097bc9a8715ef98fe405b909ff0874901e8619
parent7cb612b6fb027fd6a5524df72c3934b67d0f680d (diff)
downloadsonarqube-3a3948b47bcb86fe0bb7c427397303f54bfaa0ed.tar.gz
sonarqube-3a3948b47bcb86fe0bb7c427397303f54bfaa0ed.zip
remove unused OrganizationUpdater from UserUpdater
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/UserUpdater.java5
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplOrgMembershipSyncTest.java1
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplTest.java1
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterCreateTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterReactivateTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java3
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java2
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java4
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java4
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateLoginActionTest.java3
11 files changed, 8 insertions, 25 deletions
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 8a6da917e1c..7ed5e8d49d5 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
@@ -44,7 +44,6 @@ import org.sonar.db.user.UserPropertyDto;
import org.sonar.server.authentication.CredentialsLocalAuthentication;
import org.sonar.server.organization.DefaultOrganizationProvider;
import org.sonar.server.organization.OrganizationFlags;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.user.index.UserIndexer;
import org.sonar.server.usergroups.DefaultGroupFinder;
import org.sonar.server.util.Validation;
@@ -83,14 +82,13 @@ public class UserUpdater {
private final UserIndexer userIndexer;
private final DefaultOrganizationProvider defaultOrganizationProvider;
private final OrganizationFlags organizationFlags;
- private final OrganizationUpdater organizationUpdater;
private final DefaultGroupFinder defaultGroupFinder;
private final Configuration config;
private final CredentialsLocalAuthentication localAuthentication;
private final System2 system2;
public UserUpdater(System2 system2, NewUserNotifier newUserNotifier, DbClient dbClient, UserIndexer userIndexer, OrganizationFlags organizationFlags,
- DefaultOrganizationProvider defaultOrganizationProvider, OrganizationUpdater organizationUpdater, DefaultGroupFinder defaultGroupFinder, Configuration config,
+ DefaultOrganizationProvider defaultOrganizationProvider, DefaultGroupFinder defaultGroupFinder, Configuration config,
CredentialsLocalAuthentication localAuthentication) {
this.system2 = system2;
this.newUserNotifier = newUserNotifier;
@@ -98,7 +96,6 @@ public class UserUpdater {
this.userIndexer = userIndexer;
this.organizationFlags = organizationFlags;
this.defaultOrganizationProvider = defaultOrganizationProvider;
- this.organizationUpdater = organizationUpdater;
this.defaultGroupFinder = defaultGroupFinder;
this.config = config;
this.localAuthentication = localAuthentication;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java b/server/sonar-server/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
index 4e4809a0d83..0a1672b9dcc 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
@@ -105,7 +105,7 @@ public class HttpHeadersAuthenticationTest {
private UserIndexer userIndexer = new UserIndexer(db.getDbClient(), es.client());
private UserRegistrarImpl userIdentityAuthenticator = new UserRegistrarImpl(
db.getDbClient(),
- new UserUpdater(system2, mock(NewUserNotifier.class), db.getDbClient(), userIndexer, organizationFlags, defaultOrganizationProvider, organizationUpdater,
+ new UserUpdater(system2, mock(NewUserNotifier.class), db.getDbClient(), userIndexer, organizationFlags, defaultOrganizationProvider,
new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
defaultOrganizationProvider, organizationFlags, new DefaultGroupFinder(db.getDbClient()), null);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplOrgMembershipSyncTest.java b/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplOrgMembershipSyncTest.java
index 744b96cd8c7..c43fdb7f616 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplOrgMembershipSyncTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplOrgMembershipSyncTest.java
@@ -100,7 +100,6 @@ public class UserRegistrarImplOrgMembershipSyncTest {
userIndexer,
organizationFlags,
defaultOrganizationProvider,
- organizationUpdater,
new DefaultGroupFinder(db.getDbClient()),
settings.asConfig(),
localAuthentication);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplTest.java
index ca56cf07ce7..4673a5fce22 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/authentication/UserRegistrarImplTest.java
@@ -98,7 +98,6 @@ public class UserRegistrarImplTest {
userIndexer,
organizationFlags,
defaultOrganizationProvider,
- organizationUpdater,
new DefaultGroupFinder(db.getDbClient()),
settings.asConfig(),
localAuthentication);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterCreateTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterCreateTest.java
index 2a66852ab75..cfe9b2ac435 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterCreateTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterCreateTest.java
@@ -43,7 +43,6 @@ import org.sonar.server.authentication.CredentialsLocalAuthentication.HashMethod
import org.sonar.server.es.EsTester;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.organization.DefaultOrganizationProvider;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
import org.sonar.server.organization.TestOrganizationFlags;
import org.sonar.server.user.index.UserIndexDefinition;
@@ -81,13 +80,12 @@ public class UserUpdaterCreateTest {
private ArgumentCaptor<NewUserHandler.Context> newUserHandler = ArgumentCaptor.forClass(NewUserHandler.Context.class);
private DbSession session = db.getSession();
private UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
- private OrganizationUpdater organizationUpdater = mock(OrganizationUpdater.class);
private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.from(db);
private TestOrganizationFlags organizationFlags = TestOrganizationFlags.standalone();
private MapSettings settings = new MapSettings();
private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
- private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider, organizationUpdater,
+ private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider,
new DefaultGroupFinder(dbClient), settings.asConfig(), localAuthentication);
@Test
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterReactivateTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterReactivateTest.java
index 1c7c15f0ecc..d280c1af117 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterReactivateTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterReactivateTest.java
@@ -37,7 +37,6 @@ import org.sonar.server.authentication.CredentialsLocalAuthentication;
import org.sonar.server.authentication.CredentialsLocalAuthentication.HashMethod;
import org.sonar.server.es.EsTester;
import org.sonar.server.organization.DefaultOrganizationProvider;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
import org.sonar.server.organization.TestOrganizationFlags;
import org.sonar.server.user.index.UserIndexer;
@@ -66,12 +65,11 @@ public class UserUpdaterReactivateTest {
private NewUserNotifier newUserNotifier = mock(NewUserNotifier.class);
private DbSession session = db.getSession();
private UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
- private OrganizationUpdater organizationUpdater = mock(OrganizationUpdater.class);
private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.from(db);
private TestOrganizationFlags organizationFlags = TestOrganizationFlags.standalone();
private MapSettings settings = new MapSettings();
private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
- private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider, organizationUpdater,
+ private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider,
new DefaultGroupFinder(dbClient), settings.asConfig(), localAuthentication);;
@Test
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java
index e718e8eef1c..6e742c79a0b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java
@@ -77,12 +77,11 @@ public class UserUpdaterUpdateTest {
private NewUserNotifier newUserNotifier = mock(NewUserNotifier.class);
private DbSession session = db.getSession();
private UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
- private OrganizationUpdater organizationUpdater = mock(OrganizationUpdater.class);
private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.from(db);
private TestOrganizationFlags organizationFlags = TestOrganizationFlags.standalone();
private MapSettings settings = new MapSettings();
private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
- private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider, organizationUpdater,
+ private UserUpdater underTest = new UserUpdater(system2, newUserNotifier, dbClient, userIndexer, organizationFlags, defaultOrganizationProvider,
new DefaultGroupFinder(dbClient), settings.asConfig(), localAuthentication);
@Test
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
index 56315f7dc6f..f3b13a2a587 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
@@ -33,7 +33,6 @@ import org.sonar.server.es.EsTester;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.exceptions.NotFoundException;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
import org.sonar.server.organization.TestOrganizationFlags;
import org.sonar.server.tester.UserSessionRule;
@@ -69,7 +68,6 @@ public class ChangePasswordActionTest {
private UserUpdater userUpdater = new UserUpdater(system2, mock(NewUserNotifier.class), db.getDbClient(), new UserIndexer(db.getDbClient(), es.client()),
organizationFlags,
TestDefaultOrganizationProvider.from(db),
- mock(OrganizationUpdater.class),
new DefaultGroupFinder(db.getDbClient()),
new MapSettings().asConfig(),
localAuthentication);
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
index 5b9377ac7bd..46defe64737 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
@@ -37,7 +37,6 @@ import org.sonar.server.authentication.CredentialsLocalAuthentication;
import org.sonar.server.es.EsTester;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.organization.DefaultOrganizationProvider;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
import org.sonar.server.organization.TestOrganizationFlags;
import org.sonar.server.tester.UserSessionRule;
@@ -84,12 +83,11 @@ public class CreateActionTest {
private GroupDto defaultGroupInDefaultOrg;
private DefaultOrganizationProvider defaultOrganizationProvider = TestDefaultOrganizationProvider.from(db);
private TestOrganizationFlags organizationFlags = TestOrganizationFlags.standalone();
- private OrganizationUpdater organizationUpdater = mock(OrganizationUpdater.class);
private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
private WsActionTester tester = new WsActionTester(new CreateAction(
db.getDbClient(),
new UserUpdater(system2, mock(NewUserNotifier.class), db.getDbClient(), userIndexer, organizationFlags, defaultOrganizationProvider,
- organizationUpdater, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
+ new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
userSessionRule));
@Before
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
index 8901a4c7dd5..a618aa0d16a 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
@@ -36,7 +36,6 @@ import org.sonar.server.es.EsTester;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.organization.DefaultOrganizationProvider;
-import org.sonar.server.organization.OrganizationUpdater;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
import org.sonar.server.organization.TestOrganizationFlags;
import org.sonar.server.tester.UserSessionRule;
@@ -54,7 +53,6 @@ import static org.sonar.db.user.UserTesting.newUserDto;
public class UpdateActionTest {
- private static final OrganizationUpdater ORGANIZATION_CREATION_NOT_USED_FOR_UPDATE = null;
private MapSettings settings = new MapSettings();
private System2 system2 = new System2();
@@ -75,7 +73,7 @@ public class UpdateActionTest {
private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
private WsActionTester ws = new WsActionTester(new UpdateAction(
- new UserUpdater(system2, mock(NewUserNotifier.class), dbClient, userIndexer, organizationFlags, defaultOrganizationProvider, ORGANIZATION_CREATION_NOT_USED_FOR_UPDATE,
+ new UserUpdater(system2, mock(NewUserNotifier.class), dbClient, userIndexer, organizationFlags, defaultOrganizationProvider,
new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
userSession, new UserJsonWriter(userSession), dbClient));
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateLoginActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateLoginActionTest.java
index 8595dd72aa3..c1c322d9e16 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateLoginActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UpdateLoginActionTest.java
@@ -27,7 +27,6 @@ import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.DbTester;
-import org.sonar.db.organization.OrganizationDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.es.EsTester;
import org.sonar.server.exceptions.ForbiddenException;
@@ -65,7 +64,7 @@ public class UpdateLoginActionTest {
private WsActionTester ws = new WsActionTester(new UpdateLoginAction(db.getDbClient(), userSession,
new UserUpdater(system2, mock(NewUserNotifier.class), db.getDbClient(), new UserIndexer(db.getDbClient(), es.client()),
- null, null, null, null, null, null),
+ null, null, null, null, null),
organizationUpdater));
@Test