use of com.google.gerrit.extensions.api.groups.GroupInput in project gerrit by GerritCodeReview.
the class GroupsIT method onlyVisibleGroupsReturned.
@Test
public void onlyVisibleGroupsReturned() throws Exception {
String newGroupName = name("newGroup");
GroupInput in = new GroupInput();
in.name = newGroupName;
in.description = "a hidden group";
in.visibleToAll = false;
in.ownerId = getFromCache("Administrators").getGroupUUID().get();
gApi.groups().create(in);
setApiUser(user);
assertThat(gApi.groups().list().getAsMap()).doesNotContainKey(newGroupName);
setApiUser(admin);
gApi.groups().id(newGroupName).addMembers(user.username);
setApiUser(user);
assertThat(gApi.groups().list().getAsMap()).containsKey(newGroupName);
}
use of com.google.gerrit.extensions.api.groups.GroupInput in project gerrit by GerritCodeReview.
the class ImpersonationIT method setUp.
@Before
public void setUp() throws Exception {
anonRestSession = new RestSession(server, null);
admin2 = accounts.admin2();
GroupInput gi = new GroupInput();
gi.name = name("New-Group");
gi.members = ImmutableList.of(user.id.toString());
newGroup = gApi.groups().create(gi).get();
}
use of com.google.gerrit.extensions.api.groups.GroupInput in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method createGroupWithOwner.
protected GroupInfo createGroupWithOwner(String name, GroupInfo ownerGroup) throws Exception {
GroupInput in = new GroupInput();
in.name = name;
in.ownerId = ownerGroup.id;
return gApi.groups().create(in).get();
}
use of com.google.gerrit.extensions.api.groups.GroupInput in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method createGroupWithDescription.
protected GroupInfo createGroupWithDescription(String name, String description, AccountInfo... members) throws Exception {
GroupInput in = new GroupInput();
in.name = name;
in.description = description;
in.members = Arrays.asList(members).stream().map(a -> String.valueOf(a._accountId)).collect(toList());
return gApi.groups().create(in).get();
}
use of com.google.gerrit.extensions.api.groups.GroupInput in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method createGroupThatIsVisibleToAll.
protected GroupInfo createGroupThatIsVisibleToAll(String name) throws Exception {
GroupInput in = new GroupInput();
in.name = name;
in.visibleToAll = true;
return gApi.groups().create(in).get();
}
Aggregations