DraftChangeIT: Hoist createDraftChange up to AbstractDaemonTest
So it can be used by other tests. Rename the createDraftChange test method in CreateChangeIT to avoid compilation errors. Change-Id: Ib8b08b30a5b635e230eb102ba75871d8756f8179
This commit is contained in:
parent
97cadbab52
commit
9fb86732b9
@ -445,6 +445,10 @@ public abstract class AbstractDaemonTest {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected PushOneCommit.Result createDraftChange() throws Exception {
|
||||||
|
return pushTo("refs/drafts/master");
|
||||||
|
}
|
||||||
|
|
||||||
private static final List<Character> RANDOM =
|
private static final List<Character> RANDOM =
|
||||||
Chars.asList(new char[]{'a','b','c','d','e','f','g','h'});
|
Chars.asList(new char[]{'a','b','c','d','e','f','g','h'});
|
||||||
protected PushOneCommit.Result amendChange(String changeId)
|
protected PushOneCommit.Result amendChange(String changeId)
|
||||||
|
@ -101,13 +101,13 @@ public class CreateChangeIT extends AbstractDaemonTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createDraftChange() throws Exception {
|
public void createNewDraftChange() throws Exception {
|
||||||
assume().that(isAllowDrafts()).isTrue();
|
assume().that(isAllowDrafts()).isTrue();
|
||||||
assertCreateSucceeds(newChangeInput(ChangeStatus.DRAFT));
|
assertCreateSucceeds(newChangeInput(ChangeStatus.DRAFT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createDraftChangeNotAllowed() throws Exception {
|
public void createNewDraftChangeNotAllowed() throws Exception {
|
||||||
assume().that(isAllowDrafts()).isFalse();
|
assume().that(isAllowDrafts()).isFalse();
|
||||||
ChangeInput ci = newChangeInput(ChangeStatus.DRAFT);
|
ChangeInput ci = newChangeInput(ChangeStatus.DRAFT);
|
||||||
assertCreateFails(ci, MethodNotAllowedException.class,
|
assertCreateFails(ci, MethodNotAllowedException.class,
|
||||||
|
@ -147,10 +147,6 @@ public class DraftChangeIT extends AbstractDaemonTest {
|
|||||||
assertThat(label.all.get(0).value).isEqualTo(1);
|
assertThat(label.all.get(0).value).isEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PushOneCommit.Result createDraftChange() throws Exception {
|
|
||||||
return pushTo("refs/drafts/master");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static RestResponse deleteChange(String changeId,
|
private static RestResponse deleteChange(String changeId,
|
||||||
RestSession s) throws IOException {
|
RestSession s) throws IOException {
|
||||||
return s.delete("/changes/" + changeId);
|
return s.delete("/changes/" + changeId);
|
||||||
|
Loading…
Reference in New Issue
Block a user