Search in sources :

Example 6 with GroupBackedUser

use of com.google.gerrit.server.query.change.GroupBackedUser in project gerrit by GerritCodeReview.

the class GroupBackedUserPermissionIT method changeVisibility_changeOnBranchVisibleToAnonymousIsVisible.

@Test
public void changeVisibility_changeOnBranchVisibleToAnonymousIsVisible() throws Exception {
    Change.Id changeId = changeOperations.newChange().project(project).create();
    GroupBackedUser user = new GroupBackedUser(ImmutableSet.of(ANONYMOUS_USERS, REGISTERED_USERS, externalGroup));
    permissionBackend.user(user).change(changeNotesFactory.create(project, changeId)).check(ChangePermission.READ);
}
Also used : Change(com.google.gerrit.entities.Change) GroupBackedUser(com.google.gerrit.server.query.change.GroupBackedUser) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

GroupBackedUser (com.google.gerrit.server.query.change.GroupBackedUser)6 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)5 Test (org.junit.Test)5 Change (com.google.gerrit.entities.Change)4 GroupReference (com.google.gerrit.entities.GroupReference)1 AuthException (com.google.gerrit.extensions.restapi.AuthException)1 CurrentUser (com.google.gerrit.server.CurrentUser)1