Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchRequestBuilder;
import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchResponse;
import org.elasticsearch.xpack.core.watcher.transport.actions.put.PutWatchRequestBuilder;
import org.elasticsearch.xpack.core.watcher.transport.actions.stats.WatcherStatsRequestBuilder;
import org.elasticsearch.xpack.core.watcher.watch.Watch;
import org.elasticsearch.xpack.watcher.condition.CompareCondition;
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
Expand Down Expand Up @@ -75,6 +76,8 @@ public void testAckSingleAction() throws Exception {

assertThat(putWatchResponse.isCreated(), is(true));

assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L)));

timeWarp().trigger("_id", 4, TimeValue.timeValueSeconds(5));
AckWatchResponse ackResponse = new AckWatchRequestBuilder(client(), "_id").setActionIds("_a1").get();
assertThat(ackResponse.getStatus().actionStatus("_a1").ackStatus().state(), is(ActionStatus.AckStatus.State.ACKED));
Expand Down Expand Up @@ -146,6 +149,7 @@ public void testAckAllActions() throws Exception {
.get();

assertThat(putWatchResponse.isCreated(), is(true));
assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L)));

timeWarp().trigger("_id", 4, TimeValue.timeValueSeconds(5));

Expand Down Expand Up @@ -223,6 +227,7 @@ public void testAckWithRestart() throws Exception {
)
.get();
assertThat(putWatchResponse.isCreated(), is(true));
assertBusy(() -> assertThat(new WatcherStatsRequestBuilder(client()).get().getWatchesCount(), is(1L)));

timeWarp().trigger("_name", 4, TimeValue.timeValueSeconds(5));
restartWatcherRandomly();
Expand Down