Hoist createChange methods out of AbstractSubmit

Fix to use properly scoped topic names.

Change-Id: Id562334bbb25dccbcdecd027dddff0207afe7fee
This commit is contained in:
Dave Borowitz
2016-06-23 09:25:39 -04:00
parent 72c6449d22
commit 598591536b
2 changed files with 26 additions and 26 deletions

View File

@@ -494,6 +494,29 @@ public abstract class AbstractDaemonTest {
return pushTo("refs/drafts/master");
}
protected PushOneCommit.Result createChange(String subject,
String fileName, String content) throws Exception {
PushOneCommit push = pushFactory.create(
db, admin.getIdent(), testRepo, subject, fileName, content);
return push.to("refs/for/master");
}
protected PushOneCommit.Result createChange(String subject,
String fileName, String content, String topic)
throws Exception {
PushOneCommit push = pushFactory.create(
db, admin.getIdent(), testRepo, subject, fileName, content);
return push.to("refs/for/master/" + name(topic));
}
protected PushOneCommit.Result createChange(TestRepository<?> repo,
String branch, String subject, String fileName, String content,
String topic) throws Exception {
PushOneCommit push = pushFactory.create(
db, admin.getIdent(), repo, subject, fileName, content);
return push.to("refs/for/" + branch + "/" + name(topic));
}
protected BranchApi createBranch(Branch.NameKey branch) throws Exception {
return gApi.projects()
.name(branch.getParentKey().get())