Merge "ChangeIT: Add asserts for ref-updated events on change deletion"

This commit is contained in:
David Pursehouse 2017-04-27 08:24:39 +00:00 committed by Gerrit Code Review
commit 297c744f4e
1 changed files with 5 additions and 0 deletions

View File

@ -573,11 +573,16 @@ public class ChangeIT extends AbstractDaemonTest {
PushOneCommit.Result changeResult =
pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master");
String changeId = changeResult.getChangeId();
int id = changeResult.getChange().getId().id;
RevCommit commit = changeResult.getCommit();
setApiUser(user);
gApi.changes().id(changeId).delete();
assertThat(query(changeId)).isEmpty();
String ref = new Change.Id(id).toRefPrefix() + "1";
eventRecorder.assertRefUpdatedEvents(project.get(), ref, null, commit, commit, null);
} finally {
removePermission(Permission.DELETE_OWN_CHANGES, project, "refs/*");
}