From 9fb86732b9f32efe62dc1e2269f137ef31394f14 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 24 Feb 2016 12:03:07 +0900 Subject: [PATCH] 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 --- .../java/com/google/gerrit/acceptance/AbstractDaemonTest.java | 4 ++++ .../google/gerrit/acceptance/rest/change/CreateChangeIT.java | 4 ++-- .../google/gerrit/acceptance/rest/change/DraftChangeIT.java | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/AbstractDaemonTest.java index 3d97c937b1..6819afe908 100644 --- a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/AbstractDaemonTest.java +++ b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/AbstractDaemonTest.java @@ -445,6 +445,10 @@ public abstract class AbstractDaemonTest { return result; } + protected PushOneCommit.Result createDraftChange() throws Exception { + return pushTo("refs/drafts/master"); + } + private static final List RANDOM = Chars.asList(new char[]{'a','b','c','d','e','f','g','h'}); protected PushOneCommit.Result amendChange(String changeId) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java index 14208e96e3..d222deacd6 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java @@ -101,13 +101,13 @@ public class CreateChangeIT extends AbstractDaemonTest { } @Test - public void createDraftChange() throws Exception { + public void createNewDraftChange() throws Exception { assume().that(isAllowDrafts()).isTrue(); assertCreateSucceeds(newChangeInput(ChangeStatus.DRAFT)); } @Test - public void createDraftChangeNotAllowed() throws Exception { + public void createNewDraftChangeNotAllowed() throws Exception { assume().that(isAllowDrafts()).isFalse(); ChangeInput ci = newChangeInput(ChangeStatus.DRAFT); assertCreateFails(ci, MethodNotAllowedException.class, diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/DraftChangeIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/DraftChangeIT.java index 49c86029af..2b440ac78a 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/DraftChangeIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/DraftChangeIT.java @@ -147,10 +147,6 @@ public class DraftChangeIT extends AbstractDaemonTest { 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, RestSession s) throws IOException { return s.delete("/changes/" + changeId);