use of com.google.gerrit.entities.PermissionRange in project gerrit by GerritCodeReview.
the class RefControlTest method unionOfPermissibleVotes.
@Test
public void unionOfPermissibleVotes() throws Exception {
projectOperations.project(localKey).forUpdate().add(allowLabel(LabelId.CODE_REVIEW).ref("refs/heads/*").group(DEVS).range(-1, +1)).add(allowLabel(LabelId.CODE_REVIEW).ref("refs/heads/*").group(REGISTERED_USERS).range(-2, +2)).update();
ProjectControl u = user(localKey, DEVS);
PermissionRange range = u.controlForRef("refs/heads/master").getRange(LABEL + LabelId.CODE_REVIEW);
assertCanVote(-2, range);
assertCanVote(2, range);
}
use of com.google.gerrit.entities.PermissionRange in project gerrit by GerritCodeReview.
the class RefControlTest method unblockRange.
@Test
public void unblockRange() throws Exception {
projectOperations.project(localKey).forUpdate().add(blockLabel(LabelId.CODE_REVIEW).ref("refs/heads/*").group(ANONYMOUS_USERS).range(-1, +1)).add(allowLabel(LabelId.CODE_REVIEW).ref("refs/heads/*").group(DEVS).range(-2, +2)).update();
ProjectControl u = user(localKey, DEVS);
PermissionRange range = u.controlForRef("refs/heads/master").getRange(LABEL + LabelId.CODE_REVIEW);
assertCanVote(-2, range);
assertCanVote(2, range);
}
Aggregations