use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method reindex.
// reindex permissions are tested by {@link GroupsIT#reindexPermissions}
@Test
public void reindex() throws Exception {
GroupInfo group1 = createGroupWithDescription(name("group"), "barX");
// update group in the database so that group index is stale
String newDescription = "barY";
AccountGroup group = db.accountGroups().get(new AccountGroup.Id(group1.groupId));
group.setDescription(newDescription);
db.accountGroups().update(Collections.singleton(group));
assertQuery("description:" + group1.description, group1);
assertQuery("description:" + newDescription);
gApi.groups().id(group1.id).index();
assertQuery("description:" + group1.description);
assertQuery("description:" + newDescription, group1);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method withLimit.
@Test
public void withLimit() 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);
assertThat(result.get(result.size() - 1)._moreGroups).isNull();
result = assertQuery(newQuery(query).withLimit(2), result.subList(0, 2));
assertThat(result.get(result.size() - 1)._moreGroups).isTrue();
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method byName.
@Test
public void byName() throws Exception {
assertQuery("name:non-existing");
GroupInfo group = createGroup(name("group"));
assertQuery("name:" + group.name, group);
assertQuery("name:" + group.name.toUpperCase(Locale.US), group);
// only exact match
GroupInfo groupWithHyphen = createGroup(name("group-with-hyphen"));
createGroup(name("group-no-match-with-hyphen"));
assertQuery("name:" + groupWithHyphen.name, groupWithHyphen);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class Schema_150_to_151_Test method createGroup.
private AccountGroup.Id createGroup(String name) throws Exception {
GroupInput groupInput = new GroupInput();
groupInput.name = name;
GroupInfo groupInfo = createGroupFactory.create(name).apply(TopLevelResource.INSTANCE, groupInput);
return new Id(groupInfo.groupId);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method asAnonymous.
@Test
public void asAnonymous() throws Exception {
GroupInfo group = createGroup(name("group"));
setAnonymous();
assertQuery("uuid:" + group.id);
}
Aggregations