ChangeIT: Add a test that a reviewer can't remove themself from a merged change

Change-Id: I51451406e28e01b660038bd0b3e0ccf95e56aab1
This commit is contained in:
David Pursehouse 2018-10-09 15:06:38 +09:00
parent 9a694f0a7e
commit 31e5ee0763
1 changed files with 18 additions and 0 deletions

View File

@ -2068,6 +2068,24 @@ public class ChangeIT extends AbstractDaemonTest {
gApi.changes().id(r.getChangeId()).reviewer(admin.getId().toString()).remove();
}
@Test
public void removeReviewerSelfFromMergedChangeNotPermitted() throws Exception {
PushOneCommit.Result r = createChange();
String changeId = r.getChangeId();
setApiUser(user);
recommend(changeId);
setApiUser(admin);
approve(changeId);
gApi.changes().id(changeId).revision(r.getCommit().name()).submit();
setApiUser(user);
exception.expect(AuthException.class);
exception.expectMessage("remove reviewer not permitted");
gApi.changes().id(r.getChangeId()).reviewer("self").remove();
}
@Test
public void deleteVote() throws Exception {
PushOneCommit.Result r = createChange();