From f518501df4138d03a9ef0c98c63d05baa5045378 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Fri, 15 Dec 2017 16:00:21 +0100 Subject: [PATCH] Tests: Ensure that watcher is started in HipchatServiceTests One of those tests requires watcher to be started, so a proper assertBusy() block has been added to this tests. relates elastic/x-pack-elasticsearch#3324 Original commit: elastic/x-pack-elasticsearch@324830316f0943c91017a45a41c980871700a435 --- .../xpack/watcher/test/integration/HipChatServiceTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HipChatServiceTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HipChatServiceTests.java index 6222c59abe6..51bdc8f6692 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HipChatServiceTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HipChatServiceTests.java @@ -15,6 +15,8 @@ import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackSettings; import org.elasticsearch.xpack.XPackSingleNodeTestCase; +import org.elasticsearch.xpack.watcher.WatcherService; +import org.elasticsearch.xpack.watcher.WatcherState; import org.elasticsearch.xpack.watcher.actions.hipchat.HipChatAction; import org.elasticsearch.xpack.watcher.client.WatcherClient; import org.elasticsearch.xpack.watcher.condition.AlwaysCondition; @@ -127,6 +129,8 @@ public class HipChatServiceTests extends XPackSingleNodeTestCase { } public void testWatchWithHipChatAction() throws Exception { + assertBusy(() -> assertThat(getInstanceFromNode(WatcherService.class).state(), is(WatcherState.STARTED))); + HipChatAccount.Profile profile = randomFrom(HipChatAccount.Profile.values()); HipChatMessage.Color color = randomFrom(HipChatMessage.Color.values()); String account;