use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method globalPermissions_differentUserDoesNotEqual.
@Test
public void globalPermissions_differentUserDoesNotEqual() throws Exception {
BooleanCondition cond1 = pb.user(user()).testCond(GlobalPermission.CREATE_GROUP);
BooleanCondition cond2 = pb.user(admin()).testCond(GlobalPermission.CREATE_GROUP);
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 refPermissions_differentResourceAndSameUserDoesNotEqual.
@Test
public void refPermissions_differentResourceAndSameUserDoesNotEqual() throws Exception {
BranchNameKey branch1 = BranchNameKey.create(project, "branch");
BranchNameKey branch2 = BranchNameKey.create(project, "branch2");
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());
}
use of com.google.gerrit.extensions.conditions.BooleanCondition in project gerrit by GerritCodeReview.
the class PermissionBackendConditionIT method globalPermissions_sameUserAndPermissionEquals.
@Test
public void globalPermissions_sameUserAndPermissionEquals() throws Exception {
BooleanCondition cond1 = pb.user(user()).testCond(GlobalPermission.CREATE_GROUP);
BooleanCondition cond2 = pb.user(user()).testCond(GlobalPermission.CREATE_GROUP);
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_sameResourceAndDifferentUserDoesNotEqual.
@Test
public void refPermissions_sameResourceAndDifferentUserDoesNotEqual() throws Exception {
BranchNameKey branch = BranchNameKey.create(project, "branch");
BooleanCondition cond1 = pb.user(user()).ref(branch).testCond(RefPermission.READ);
BooleanCondition cond2 = pb.user(admin()).ref(branch).testCond(RefPermission.READ);
assertNotEquals(cond1, cond2);
assertNotEquals(cond1.hashCode(), cond2.hashCode());
}
Aggregations