Add query operator that matches groups that are visible to all users
Change-Id: I161d66f26ace58a8e0d6a6183853936336ed0d15 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -241,6 +241,17 @@ public abstract class AbstractQueryGroupsTest extends GerritServerTests {
|
||||
assertQuery("owner:" + ownerGroup.id, group, ownerGroup);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byIsVisibleToAll() throws Exception {
|
||||
assertQuery("is:visibleToAll");
|
||||
|
||||
GroupInfo groupThatIsVisibleToAll =
|
||||
createGroupThatIsVisibleToAll(name("group-that-is-visible-to-all"));
|
||||
createGroup(name("group"));
|
||||
|
||||
assertQuery("is:visibleToAll", groupThatIsVisibleToAll);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withLimit() throws Exception {
|
||||
GroupInfo group1 = createGroup(name("group1"));
|
||||
@@ -318,6 +329,14 @@ public abstract class AbstractQueryGroupsTest extends GerritServerTests {
|
||||
return gApi.groups().create(in).get();
|
||||
}
|
||||
|
||||
protected GroupInfo createGroupThatIsVisibleToAll(String name)
|
||||
throws Exception {
|
||||
GroupInput in = new GroupInput();
|
||||
in.name = name;
|
||||
in.visibleToAll = true;
|
||||
return gApi.groups().create(in).get();
|
||||
}
|
||||
|
||||
protected GroupInfo getGroup(AccountGroup.UUID uuid) throws Exception {
|
||||
return gApi.groups().id(uuid.get()).get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user