use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method withStart.
@Test
public void withStart() throws Exception {
GroupInfo group1 = createGroup(name("group1"));
GroupInfo group2 = createGroup(name("group2"));
GroupInfo group3 = createGroup(name("group3"));
String query = "uuid:" + group1.id + " OR uuid:" + group2.id + " OR uuid:" + group3.id;
List<GroupInfo> result = assertQuery(query, group1, group2, group3);
assertQuery(newQuery(query).withStart(1), result.subList(1, 3));
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method byDefaultField.
@Test
public void byDefaultField() throws Exception {
GroupInfo group1 = createGroup(name("foo-group"));
GroupInfo group2 = createGroup(name("group2"));
GroupInfo group3 = createGroupWithDescription(name("group3"), "decription that contains foo and the UUID of group2: " + group2.id);
assertQuery("non-existing");
assertQuery("foo", group1, group3);
assertQuery(group2.id, group2, group3);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method format.
protected String format(Iterable<GroupInfo> groups) {
StringBuilder b = new StringBuilder();
b.append("[");
Iterator<GroupInfo> it = groups.iterator();
while (it.hasNext()) {
GroupInfo g = it.next();
b.append("{").append(g.id).append(", ").append("name=").append(g.name).append(", ").append("groupId=").append(g.groupId).append(", ").append("url=").append(g.url).append(", ").append("ownerId=").append(g.ownerId).append(", ").append("owner=").append(g.owner).append(", ").append("description=").append(g.description).append(", ").append("visibleToAll=").append(toBoolean(g.options.visibleToAll)).append("}");
if (it.hasNext()) {
b.append(", ");
}
}
b.append("]");
return b.toString();
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method byOwner.
@Test
public void byOwner() throws Exception {
GroupInfo ownerGroup = createGroup(name("owner-group"));
GroupInfo group = createGroupWithOwner(name("group"), ownerGroup);
createGroup(name("group2"));
assertQuery("owner:" + group.id);
// ownerGroup owns itself
assertQuery("owner:" + ownerGroup.id, group, ownerGroup);
assertQuery("owner:" + ownerGroup.name, group, ownerGroup);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method createGroupWithProperties.
@Test
public void createGroupWithProperties() throws Exception {
GroupInput in = new GroupInput();
in.name = name("newGroup");
in.description = "Test description";
in.visibleToAll = true;
in.ownerId = getFromCache("Administrators").getGroupUUID().get();
GroupInfo g = gApi.groups().create(in).detail();
assertThat(g.description).isEqualTo(in.description);
assertThat(g.options.visibleToAll).isEqualTo(in.visibleToAll);
assertThat(g.ownerId).isEqualTo(in.ownerId);
}
Aggregations