Skip to content

Commit 889e695

Browse files
committed
Adjust unit test to confirm null permission fix (issue-259)
1 parent 139c6da commit 889e695

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/java/com/gitblit/tests/Issue0259Test.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ private void testTeams(boolean reverseOrder) throws Exception {
132132
a.teams.add(t2);
133133
}
134134

135+
// simulate a repository rename
136+
a.setRepositoryPermission("projects/renamed.git", null);
137+
t1.setRepositoryPermission("projects/renamed.git", null);
138+
t2.setRepositoryPermission("projects/renamed.git", null);
139+
135140
assertEquals(AccessPermission.CLONE, a.getRepositoryPermission(test).permission);
136141
assertEquals(AccessPermission.DELETE, a.getRepositoryPermission(projects_test).permission);
137142

@@ -185,6 +190,10 @@ private void testTeam(boolean reverseOrder) throws Exception {
185190
}
186191
UserModel a = new UserModel("a");
187192
a.teams.add(t1);
193+
194+
// simulate a repository rename
195+
a.setRepositoryPermission("projects/renamed.git", null);
196+
t1.setRepositoryPermission("projects/renamed.git", null);
188197

189198
assertEquals(AccessPermission.CLONE, a.getRepositoryPermission(test).permission);
190199
assertTrue(a.canClone(test));
@@ -199,6 +208,6 @@ private void testTeam(boolean reverseOrder) throws Exception {
199208
// R permission is found first
200209
assertEquals(AccessPermission.CLONE, a.getRepositoryPermission(projects_test).permission);
201210
assertFalse(a.canDeleteRef(projects_test));
202-
}
211+
}
203212
}
204213
}

0 commit comments

Comments
 (0)