use of com.google.gerrit.entities.GroupReference in project gerrit by GerritCodeReview.
the class GroupNameNotesTest method loadedGroupsContainGroupsWithDuplicateGroupUuids.
@Test
public void loadedGroupsContainGroupsWithDuplicateGroupUuids() throws Exception {
createGroup(groupUuid, groupName);
AccountGroup.NameKey anotherGroupName = AccountGroup.nameKey("admins");
createGroup(groupUuid, anotherGroupName);
ImmutableList<GroupReference> allGroups = GroupNameNotes.loadAllGroups(repo);
GroupReference group1 = GroupReference.create(groupUuid, groupName.get());
GroupReference group2 = GroupReference.create(groupUuid, anotherGroupName.get());
assertThat(allGroups).containsExactly(group1, group2);
}
use of com.google.gerrit.entities.GroupReference in project gerrit by GerritCodeReview.
the class GroupListTest method references.
@Test
public void references() throws Exception {
Collection<GroupReference> result = groupList.references();
assertEquals(2, result.size());
AccountGroup.UUID uuid = AccountGroup.uuid("ebe31c01aec2c9ac3b3c03e87a47450829ff4310");
GroupReference expected = GroupReference.create(uuid, "Administrators");
assertTrue(result.contains(expected));
}
use of com.google.gerrit.entities.GroupReference in project gerrit by GerritCodeReview.
the class GroupListTest method put.
@Test
public void put() {
AccountGroup.UUID uuid = AccountGroup.uuid("abc");
GroupReference groupReference = GroupReference.create(uuid, "Hutzliputz");
groupList.put(uuid, groupReference);
assertEquals(3, groupList.references().size());
GroupReference found = groupList.byUUID(uuid);
assertEquals(groupReference, found);
}
use of com.google.gerrit.entities.GroupReference in project gerrit by GerritCodeReview.
the class GroupReferenceTest method forGroupDescription.
@Test
public void forGroupDescription() {
String name = "foo";
AccountGroup.UUID uuid = AccountGroup.uuid("uuid-foo");
GroupReference groupReference = GroupReference.forGroup(new GroupDescription.Basic() {
@Override
public String getUrl() {
return null;
}
@Override
public String getName() {
return name;
}
@Override
public UUID getGroupUUID() {
return uuid;
}
@Override
public String getEmailAddress() {
return null;
}
});
assertThat(groupReference.getName()).isEqualTo(name);
assertThat(groupReference.getUUID()).isEqualTo(uuid);
}
Aggregations