DownstreamCreatorIT: Don't inject CurrentUser
Use the user member provided by AbstractDaemonTest.
Change-Id: Ie07e54da6102d29959e2a9a658925d9ac0f376ed
diff --git a/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java b/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
index 5ad129f..ce86869 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
@@ -49,11 +49,9 @@
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
-import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.group.SystemGroupBackend;
import com.google.gerrit.testing.TestTimeUtil;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.googlesource.gerrit.plugins.automerger.helpers.ConfigOption;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -72,7 +70,6 @@
name = "automerger",
sysModule = "com.googlesource.gerrit.plugins.automerger.AutomergerModule")
public class DownstreamCreatorIT extends LightweightPluginDaemonTest {
- @Inject private Provider<CurrentUser> user;
@Inject private GroupOperations groupOperations;
@Inject private ProjectOperations projectOperations;
@@ -799,9 +796,9 @@
initialResult.assertOkStatus();
merge(initialResult);
- // Create normalUserGroup, containing current user, and contextUserGroup, containing contextUser
+ // Create normalUserGroup, containing user, and contextUserGroup, containing contextUser
String normalUserGroup = groupOperations.newGroup().name("normalUserGroup").create().get();
- gApi.groups().id(normalUserGroup).addMembers(user.get().getAccountId().toString());
+ gApi.groups().id(normalUserGroup).addMembers(user.id().toString());
AccountApi contextUserApi = gApi.accounts().create("someContextUser");
String contextUserGroup = groupOperations.newGroup().name("contextUserGroup").create().get();
gApi.groups().id(contextUserGroup).addMembers(contextUserApi.get().name);
@@ -866,9 +863,9 @@
initialResult.assertOkStatus();
merge(initialResult);
- // Create normalUserGroup, containing current user, and contextUserGroup, containing contextUser
+ // Create normalUserGroup, containing user, and contextUserGroup, containing contextUser
String normalUserGroup = groupOperations.newGroup().name("normalUserGroup").create().get();
- gApi.groups().id(normalUserGroup).addMembers(user.get().getAccountId().toString());
+ gApi.groups().id(normalUserGroup).addMembers(user.id().toString());
AccountApi contextUserApi = gApi.accounts().create("randomContextUser");
String contextUserGroup = groupOperations.newGroup().name("contextUserGroup").create().get();
gApi.groups().id(contextUserGroup).addMembers(contextUserApi.get().name);
@@ -960,7 +957,7 @@
// Create normalUserGroup, containing current user, and contextUserGroup, containing contextUser
String normalUserGroup = groupOperations.newGroup().name("normalUserGroup").create().get();
- gApi.groups().id(normalUserGroup).addMembers(user.get().getAccountId().toString());
+ gApi.groups().id(normalUserGroup).addMembers(user.id().toString());
AccountApi contextUserApi = gApi.accounts().create("asdfContextUser");
String contextUserGroup = groupOperations.newGroup().name("contextUserGroup").create().get();
gApi.groups().id(contextUserGroup).addMembers(contextUserApi.get().name);