use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method changePermissions_differentResourceSameUserDoesNotEqual.
@Test
public void changePermissions_differentResourceSameUserDoesNotEqual() throws Exception {
ChangeData change1 = createChange().getChange();
ChangeData change2 = createChange().getChange();
BooleanCondition cond1 = pb.user(user()).change(change1).testCond(ChangePermission.READ);
BooleanCondition cond2 = pb.user(user()).change(change2).testCond(ChangePermission.READ);
assertNotEquals(cond1, cond2);
assertNotEquals(cond1.hashCode(), cond2.hashCode());
}
use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method changePermissions_sameResourceDifferentUserDoesNotEqual.
@Test
public void changePermissions_sameResourceDifferentUserDoesNotEqual() throws Exception {
ChangeData change = createChange().getChange();
BooleanCondition cond1 = pb.user(user()).change(change).testCond(ChangePermission.READ);
BooleanCondition cond2 = pb.user(admin()).change(change).testCond(ChangePermission.READ);
assertNotEquals(cond1, cond2);
assertNotEquals(cond1.hashCode(), cond2.hashCode());
}
use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method projectPermissions_differentResourceSameUserDoesNotEqual.
@Test
public void projectPermissions_differentResourceSameUserDoesNotEqual() throws Exception {
Project.NameKey project2 = projectOperations.newProject().create();
BooleanCondition cond1 = pb.user(user()).project(project).testCond(ProjectPermission.READ);
BooleanCondition cond2 = pb.user(user()).project(project2).testCond(ProjectPermission.READ);
assertNotEquals(cond1, cond2);
assertNotEquals(cond1.hashCode(), cond2.hashCode());
}
use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method changePermissions_sameResourceAndUserEquals.
@Test
public void changePermissions_sameResourceAndUserEquals() throws Exception {
ChangeData change = createChange().getChange();
BooleanCondition cond1 = pb.user(user()).change(change).testCond(ChangePermission.READ);
BooleanCondition cond2 = pb.user(user()).change(change).testCond(ChangePermission.READ);
assertEquals(cond1, cond2);
assertEquals(cond1.hashCode(), cond2.hashCode());
}
use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method refPermissions_differentResourceAndSameUserDoesNotEqual2.
@Test
public void refPermissions_differentResourceAndSameUserDoesNotEqual2() throws Exception {
BranchNameKey branch1 = BranchNameKey.create(project, "branch");
BranchNameKey branch2 = BranchNameKey.create(projectOperations.newProject().create(), "branch");
BooleanCondition cond1 = pb.user(user()).ref(branch1).testCond(RefPermission.READ);
BooleanCondition cond2 = pb.user(user()).ref(branch2).testCond(RefPermission.READ);
assertNotEquals(cond1, cond2);
assertNotEquals(cond1.hashCode(), cond2.hashCode());
}
Aggregations