|
24 | 24 | import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchRequestBuilder;
|
25 | 25 | import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchResponse;
|
26 | 26 | import org.elasticsearch.xpack.core.watcher.transport.actions.put.PutWatchRequestBuilder;
|
| 27 | +import org.elasticsearch.xpack.core.watcher.transport.actions.stats.WatcherStatsRequestBuilder; |
27 | 28 | import org.elasticsearch.xpack.core.watcher.watch.Watch;
|
28 | 29 | import org.elasticsearch.xpack.watcher.condition.CompareCondition;
|
29 | 30 | import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
|
@@ -75,6 +76,8 @@ public void testAckSingleAction() throws Exception {
|
75 | 76 |
|
76 | 77 | assertThat(putWatchResponse.isCreated(), is(true));
|
77 | 78 |
|
| 79 | + assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L))); |
| 80 | + |
78 | 81 | timeWarp().trigger("_id", 4, TimeValue.timeValueSeconds(5));
|
79 | 82 | AckWatchResponse ackResponse = new AckWatchRequestBuilder(client(), "_id").setActionIds("_a1").get();
|
80 | 83 | assertThat(ackResponse.getStatus().actionStatus("_a1").ackStatus().state(), is(ActionStatus.AckStatus.State.ACKED));
|
@@ -146,6 +149,7 @@ public void testAckAllActions() throws Exception {
|
146 | 149 | .get();
|
147 | 150 |
|
148 | 151 | assertThat(putWatchResponse.isCreated(), is(true));
|
| 152 | + assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L))); |
149 | 153 |
|
150 | 154 | timeWarp().trigger("_id", 4, TimeValue.timeValueSeconds(5));
|
151 | 155 |
|
@@ -223,6 +227,7 @@ public void testAckWithRestart() throws Exception {
|
223 | 227 | )
|
224 | 228 | .get();
|
225 | 229 | assertThat(putWatchResponse.isCreated(), is(true));
|
| 230 | + assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L))); |
226 | 231 |
|
227 | 232 | timeWarp().trigger("_name", 4, TimeValue.timeValueSeconds(5));
|
228 | 233 | restartWatcherRandomly();
|
|
0 commit comments