Hoist createChange methods out of AbstractSubmit
Fix to use properly scoped topic names. Change-Id: Id562334bbb25dccbcdecd027dddff0207afe7fee
This commit is contained in:
parent
72c6449d22
commit
598591536b
@ -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())
|
||||
|
@ -128,9 +128,9 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
|
||||
approve(change2.getChangeId());
|
||||
approve(change3.getChangeId());
|
||||
submit(change3.getChangeId());
|
||||
change1.assertChange(Change.Status.MERGED, "test-topic", admin);
|
||||
change2.assertChange(Change.Status.MERGED, "test-topic", admin);
|
||||
change3.assertChange(Change.Status.MERGED, "test-topic", admin);
|
||||
change1.assertChange(Change.Status.MERGED, name("test-topic"), admin);
|
||||
change2.assertChange(Change.Status.MERGED, name("test-topic"), admin);
|
||||
change3.assertChange(Change.Status.MERGED, name("test-topic"), admin);
|
||||
// Check for the exact change to have the correct submitter.
|
||||
assertSubmitter(change3);
|
||||
// Also check submitters for changes submitted via the topic relationship.
|
||||
@ -205,29 +205,6 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
|
||||
}
|
||||
}
|
||||
|
||||
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/" + 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 void submit(String changeId) throws Exception {
|
||||
submit(changeId, new SubmitInput(), null, null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user