GroupsIT: Move createGroup() methods to AbstractDaemonTest
So they can be reused in other tests. Change-Id: I6735111c2c93053873e87c87f0bc43c4ea1b446d
This commit is contained in:
@@ -31,6 +31,7 @@ import com.google.gerrit.common.data.PermissionRule;
|
||||
import com.google.gerrit.extensions.api.GerritApi;
|
||||
import com.google.gerrit.extensions.api.changes.ReviewInput;
|
||||
import com.google.gerrit.extensions.api.changes.RevisionApi;
|
||||
import com.google.gerrit.extensions.api.groups.GroupInput;
|
||||
import com.google.gerrit.extensions.api.projects.BranchApi;
|
||||
import com.google.gerrit.extensions.api.projects.BranchInput;
|
||||
import com.google.gerrit.extensions.api.projects.ProjectInput;
|
||||
@@ -746,4 +747,17 @@ public abstract class AbstractDaemonTest {
|
||||
assertThat(ctls).hasSize(1);
|
||||
return changeResourceFactory.create(ctls.get(0));
|
||||
}
|
||||
|
||||
protected String createGroup(String name) throws Exception {
|
||||
return createGroup(name, "Administrators");
|
||||
}
|
||||
|
||||
protected String createGroup(String name, String owner) throws Exception {
|
||||
name = name(name);
|
||||
GroupInput in = new GroupInput();
|
||||
in.name = name;
|
||||
in.ownerId = owner;
|
||||
gApi.groups().create(in);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user