use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method createGroupWithUuid.
@Test
public void createGroupWithUuid() throws Exception {
AccountGroup.UUID uuid = AccountGroup.UUID.parse("4eb25d1cca562f53b9356117f33840706a36a349");
GroupInput input = new GroupInput();
input.uuid = uuid.get();
input.name = name("new-group");
GroupInfo info = gApi.groups().create(input).get();
assertThat(info.name).isEqualTo(input.name);
assertThat(info.id).isEqualTo(input.uuid);
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method cachedGroupsForMemberAreUpdatedOnGroupCreation.
@Test
public void cachedGroupsForMemberAreUpdatedOnGroupCreation() throws Exception {
Account.Id accountId = accountOperations.newAccount().create();
// Fill the cache for the observed account.
groupIncludeCache.getGroupsWithMember(accountId);
GroupInput groupInput = new GroupInput();
groupInput.name = name("Users");
groupInput.members = ImmutableList.of(String.valueOf(accountId.get()));
GroupInfo group = gApi.groups().create(groupInput).get();
Collection<AccountGroup.UUID> groups = groupIncludeCache.getGroupsWithMember(accountId);
assertThat(groups).containsExactly(AccountGroup.uuid(group.id));
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method allGroupInfoFieldsSetCorrectly.
@Test
public void allGroupInfoFieldsSetCorrectly() throws Exception {
InternalGroup adminGroup = adminGroup();
Map<String, GroupInfo> groups = gApi.groups().list().addGroup(adminGroup.getName()).getAsMap();
assertThatMap(groups).keys().containsExactly("Administrators");
assertGroupInfo(adminGroup, Iterables.getOnlyElement(groups.values()));
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method getSystemGroupByConfiguredName.
@Test
@GerritConfig(name = "groups.global:Anonymous-Users.name", value = "All Users")
public void getSystemGroupByConfiguredName() throws Exception {
GroupReference anonymousUsersGroup = systemGroupBackend.getGroup(ANONYMOUS_USERS);
assertThat(anonymousUsersGroup.getName()).isEqualTo("All Users");
GroupInfo group = gApi.groups().id(anonymousUsersGroup.getUUID().get()).get();
assertThat(group.name).isEqualTo(anonymousUsersGroup.getName());
group = gApi.groups().id(anonymousUsersGroup.getName()).get();
assertThat(group.id).isEqualTo(Url.encode(anonymousUsersGroup.getUUID().get()));
}
use of com.google.gerrit.extensions.common.GroupInfo in project gerrit by GerritCodeReview.
the class GroupsIT method getSystemGroupByDefaultName.
@Test
public void getSystemGroupByDefaultName() throws Exception {
GroupReference anonymousUsersGroup = systemGroupBackend.getGroup(ANONYMOUS_USERS);
GroupInfo group = gApi.groups().id("Anonymous Users").get();
assertThat(group.name).isEqualTo(anonymousUsersGroup.getName());
assertThat(group.id).isEqualTo(Url.encode(anonymousUsersGroup.getUUID().get()));
}
Aggregations