use of com.google.gerrit.server.group.db.Groups in project gerrit by GerritCodeReview.
the class GroupsIT method groupsOfUserCanBeListedInSlaveMode.
@Test
@Sandboxed
public void groupsOfUserCanBeListedInSlaveMode() throws Exception {
GroupInput groupInput = new GroupInput();
groupInput.name = name("contributors");
groupInput.members = ImmutableList.of(user.username());
gApi.groups().create(groupInput).get();
restartAsSlave();
requestScopeOperations.setApiUser(user.id());
List<GroupInfo> groups = gApi.groups().list().withUser(user.username()).get();
ImmutableList<String> groupNames = groups.stream().map(group -> group.name).collect(toImmutableList());
assertThat(groupNames).contains(groupInput.name);
}
Aggregations