diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java index 479bffb8f3a..b4adbc71bcf 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java @@ -74,8 +74,7 @@ public class WatcherSearchTemplateService extends AbstractComponent { BytesReference source = request.getSearchSource(); if (source != null && source.length() > 0) { try (XContentParser parser = XContentFactory.xContent(source).createParser(xContentRegistry, source)) { - sourceBuilder.parseXContent(new QueryParseContext(parser, parseFieldMatcher), - searchRequestParsers.suggesters); + sourceBuilder.parseXContent(new QueryParseContext(parser, parseFieldMatcher)); searchRequest.source(sourceBuilder); } } diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java index cb955611e06..81f7d3ffdbd 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java @@ -144,7 +144,7 @@ public class SearchInputTests extends ESIntegTestCase { XContentParser parser = createParser(builder); parser.nextToken(); - SearchRequestParsers searchParsers = new SearchRequestParsers(null); + SearchRequestParsers searchParsers = new SearchRequestParsers(); SearchInputFactory factory = new SearchInputFactory(Settings.EMPTY, WatcherClientProxy.of(client()), searchParsers, xContentRegistry(), scriptService()); diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java index 20ae0b945ab..415f85123e2 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java @@ -288,7 +288,7 @@ public class WatchTests extends ESTestCase { ActionRegistry actionRegistry = registry(Collections.emptyList(), conditionRegistry, transformRegistry); Watch.Parser watchParser = new Watch.Parser(settings, triggerService, actionRegistry, inputRegistry, null, Clock.systemUTC()); - SearchRequestParsers searchParsers = new SearchRequestParsers(null); + SearchRequestParsers searchParsers = new SearchRequestParsers(); WatcherSearchTemplateService searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, searchParsers, xContentRegistry()); @@ -409,7 +409,7 @@ public class WatchTests extends ESTestCase { Map parsers = new HashMap<>(); switch (inputType) { case SearchInput.TYPE: - SearchRequestParsers searchParsers = new SearchRequestParsers(null); + SearchRequestParsers searchParsers = new SearchRequestParsers(); parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, searchParsers, xContentRegistry(), scriptService)); return new InputRegistry(Settings.EMPTY, parsers); default: @@ -457,7 +457,7 @@ public class WatchTests extends ESTestCase { } private TransformRegistry transformRegistry() { - SearchRequestParsers searchParsers = new SearchRequestParsers(null); + SearchRequestParsers searchParsers = new SearchRequestParsers(); Map factories = new HashMap<>(); factories.put(ScriptTransform.TYPE, new ScriptTransformFactory(settings, scriptService)); factories.put(SearchTransform.TYPE, new SearchTransformFactory(settings, client, searchParsers, xContentRegistry(), scriptService)); diff --git a/qa/smoke-test-watcher/src/test/java/org/elasticsearch/smoketest/PreventFailingBuildIT.java b/qa/smoke-test-watcher/src/test/java/org/elasticsearch/smoketest/PreventFailingBuildIT.java new file mode 100644 index 00000000000..e41b5a7dad4 --- /dev/null +++ b/qa/smoke-test-watcher/src/test/java/org/elasticsearch/smoketest/PreventFailingBuildIT.java @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.smoketest; + +import org.elasticsearch.test.ESIntegTestCase; + +public class PreventFailingBuildIT extends ESIntegTestCase { + + public void testSoThatTestsDoNotFail() { + // Noop + + // This is required because SmokeTestWatcherClientYamlTestSuiteIT + // requires network access, so if network tests are not enable no + // tests will be run in the entire project and all tests will fail. + } +}