diff --git a/x-pack/plugin/async-search/build.gradle b/x-pack/plugin/async-search/build.gradle index 8aac2b9f885..156b6374e82 100644 --- a/x-pack/plugin/async-search/build.gradle +++ b/x-pack/plugin/async-search/build.gradle @@ -18,8 +18,6 @@ archivesBaseName = 'x-pack-async-search' compileJava.options.compilerArgs << "-Xlint:-rawtypes" compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" -integTest.enabled = false - // add all sub-projects of the qa sub-project gradle.projectsEvaluated { project.subprojects @@ -40,3 +38,16 @@ dependencies { dependencyLicenses { ignoreSha 'x-pack-core' } + +integTest.enabled = false + +// Instead we create a separate task to run the +// tests based on ESIntegTestCase +task internalClusterTest(type: Test) { + description = 'Java fantasy integration tests' + mustRunAfter test + + include '**/*IT.class' +} + +check.dependsOn internalClusterTest diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java similarity index 99% rename from x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionTests.java rename to x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java index a3fc60b79f2..e507ca0e70f 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo; // TODO: add tests for keepAlive and expiration -public class AsyncSearchActionTests extends AsyncSearchIntegTestCase { +public class AsyncSearchActionIT extends AsyncSearchIntegTestCase { private String indexName; private int numShards; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java index 748c6d12acc..579e16282d2 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java @@ -72,10 +72,10 @@ public class RestSubmitAsyncSearchActionTests extends ESTestCase { dispatchRequest(submitAsyncRestRequest); SubmitAsyncSearchRequest submitRequest = (SubmitAsyncSearchRequest) lastCapturedRequest; assertEquals(TimeValue.timeValueSeconds(1), submitRequest.getWaitForCompletionTimeout()); - assertEquals(false, submitRequest.isKeepOnCompletion()); + assertFalse(submitRequest.isKeepOnCompletion()); assertEquals(TimeValue.timeValueDays(5), submitRequest.getKeepAlive()); // check parameters we implicitly set in the SubmitAsyncSearchRequest ctor - assertEquals(false, submitRequest.getSearchRequest().isCcsMinimizeRoundtrips()); + assertFalse(submitRequest.getSearchRequest().isCcsMinimizeRoundtrips()); assertEquals(5, submitRequest.getSearchRequest().getBatchedReduceSize()); assertEquals(true, submitRequest.getSearchRequest().requestCache()); assertEquals(1, submitRequest.getSearchRequest().getPreFilterShardSize().intValue()); @@ -92,8 +92,8 @@ public class RestSubmitAsyncSearchActionTests extends ESTestCase { boolean requestCache = randomBoolean(); doTestParameter("request_cache", Boolean.toString(requestCache), requestCache, r -> r.getSearchRequest().requestCache()); - Integer batchReduceSize = randomIntBetween(2, 50); - doTestParameter("batched_reduce_size", Integer.toString(batchReduceSize), batchReduceSize, + int batchedReduceSize = randomIntBetween(2, 50); + doTestParameter("batched_reduce_size", Integer.toString(batchedReduceSize), batchedReduceSize, r -> r.getSearchRequest().getBatchedReduceSize()); }