[TEST] Clean up watch created by stats test.

This may have resulted in a watch being run during shutdown.

Original commit: elastic/x-pack-elasticsearch@2631690f1a
This commit is contained in:
Brian Murphy 2015-07-01 13:45:49 -04:00
parent 0325aeeb5f
commit a3c5292b24
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import org.elasticsearch.watcher.client.WatcherClient;
import org.elasticsearch.watcher.condition.ConditionBuilders;
import org.elasticsearch.watcher.test.AbstractWatcherIntegrationTests;
import org.elasticsearch.watcher.test.WatcherTestUtils;
import org.elasticsearch.watcher.transport.actions.delete.DeleteWatchResponse;
import org.elasticsearch.watcher.transport.actions.stats.WatcherStatsRequest;
import org.elasticsearch.watcher.transport.actions.stats.WatcherStatsResponse;
import org.junit.Test;
@ -81,5 +82,8 @@ public class WatcherStatsTests extends AbstractWatcherIntegrationTests {
assertThat(response.getWatcherState(), is(WatcherState.STARTED));
assertThat(response.getWatchesCount(), is(1L));
assertThat(response.getThreadPoolMaxSize(), greaterThan(0L));
DeleteWatchResponse deleteWatchResponse = watcherClient.prepareDeleteWatch("_name").get();
assertThat(deleteWatchResponse.isFound(), is(true));
}
}