diff --git a/x-pack/plugin/searchable-snapshots/build.gradle b/x-pack/plugin/searchable-snapshots/build.gradle index 9a7304f9dc890..049dae0185e67 100644 --- a/x-pack/plugin/searchable-snapshots/build.gradle +++ b/x-pack/plugin/searchable-snapshots/build.gradle @@ -1,4 +1,6 @@ import org.elasticsearch.gradle.info.BuildParams + +apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.esplugin' esplugin { name 'searchable-snapshots' @@ -10,7 +12,7 @@ archivesBaseName = 'x-pack-searchable-snapshots' dependencies { compileOnly project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + internalClusterTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } // xpack modules are installed in real clusters as the meta plugin, so diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/blobstore/cache/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/blobstore/cache/SearchableSnapshotsBlobStoreCacheIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/blobstore/cache/SearchableSnapshotsBlobStoreCacheIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/blobstore/cache/SearchableSnapshotsBlobStoreCacheIntegTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/LocalStateSearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/LocalStateSearchableSnapshots.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/LocalStateSearchableSnapshots.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/LocalStateSearchableSnapshots.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCacheClearingIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCacheClearingIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCacheClearingIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCacheClearingIntegTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java similarity index 99% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java index c6fadc94983f7..68e01d979edd2 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java @@ -47,6 +47,7 @@ import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsResponse; import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService; +import org.hamcrest.Matchers; import java.io.IOException; import java.nio.file.Files; @@ -78,7 +79,6 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.lessThanOrEqualTo; public class SearchableSnapshotsIntegTests extends BaseSearchableSnapshotsIntegTestCase { @@ -737,7 +737,7 @@ private void assertSearchableSnapshotStats(String indexName, boolean cacheEnable new SearchableSnapshotsStatsRequest(indexName) ).actionGet(); final NumShards restoredNumShards = getNumShards(indexName); - assertThat(statsResponse.getStats(), hasSize(restoredNumShards.totalNumShards)); + assertThat(statsResponse.getStats(), Matchers.hasSize(restoredNumShards.totalNumShards)); final long totalSize = statsResponse.getStats() .stream() diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsPrewarmingIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsPrewarmingIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsPrewarmingIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsPrewarmingIntegTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsUuidValidationIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsUuidValidationIntegTests.java similarity index 100% rename from x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsUuidValidationIntegTests.java rename to x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsUuidValidationIntegTests.java diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index f4e4056848b5b..26d6b2c318359 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -2,6 +2,7 @@ import org.elasticsearch.gradle.info.BuildParams apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.publish' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-security' description 'Elasticsearch Expanded Pack Plugin - Security' @@ -21,6 +22,7 @@ dependencies { testImplementation project(path: xpackModule('sql:sql-action')) testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + internalClusterTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') api 'com.unboundid:unboundid-ldapsdk:4.0.8' @@ -134,11 +136,17 @@ dependencies { compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" +processInternalClusterTestResources { + from(project(xpackModule('core')).file('src/main/config')) + from(project(xpackModule('core')).file('src/test/resources')) +} + processTestResources { from(project(xpackModule('core')).file('src/main/config')) from(project(xpackModule('core')).file('src/test/resources')) } + configurations { testArtifacts.extendsFrom testRuntime testArtifacts.extendsFrom testImplementation @@ -464,7 +472,7 @@ if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { ) } -test { +internalClusterTest { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. diff --git a/x-pack/plugin/security/qa/basic-enable-security/build.gradle b/x-pack/plugin/security/qa/basic-enable-security/build.gradle index 292a3e7cf8851..0bf30d055e765 100644 --- a/x-pack/plugin/security/qa/basic-enable-security/build.gradle +++ b/x-pack/plugin/security/qa/basic-enable-security/build.gradle @@ -1,21 +1,20 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask +import org.elasticsearch.gradle.test.rest.JavaRestTestPlugin -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -integTest { +javaRestTest { description = "Run tests against a cluster that doesn't have security" systemProperty 'tests.has_security', 'false' } -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'DEFAULT' numberOfNodes = 2 setting 'xpack.ml.enabled', 'false' @@ -23,14 +22,15 @@ testClusters.integTest { setting 'xpack.security.enabled', 'false' } -task integTestSecurity(type: StandaloneRestIntegTestTask) { - description = "Run tests against a cluster that has security" - useCluster testClusters.integTest - dependsOn integTest +task javaRestTestWithSecurity(type: StandaloneRestIntegTestTask) { + description = "Run tests against a cluster that has security enabled" + useCluster testClusters.javaRestTest + dependsOn javaRestTest systemProperty 'tests.has_security', 'true' - + testClassesDirs = sourceSets.javaRestTest.output.classesDirs + classpath = sourceSets.javaRestTest.runtimeClasspath doFirst { - testClusters.integTest { + testClusters.javaRestTest { // Reconfigure cluster to enable security setting 'xpack.security.enabled', 'true' setting 'xpack.security.authc.anonymous.roles', 'anonymous' @@ -40,18 +40,18 @@ task integTestSecurity(type: StandaloneRestIntegTestTask) { setting 'xpack.security.transport.ssl.key_passphrase', 'transport-password' setting 'xpack.security.transport.ssl.certificate_authorities', 'ca.crt' - extraConfigFile 'transport.key', file('src/test/resources/ssl/transport.key') - extraConfigFile 'transport.crt', file('src/test/resources/ssl/transport.crt') - extraConfigFile 'ca.crt', file('src/test/resources/ssl/ca.crt') - extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') + extraConfigFile 'transport.key', file('src/javaRestTest/resources/ssl/transport.key') + extraConfigFile 'transport.crt', file('src/javaRestTest/resources/ssl/transport.crt') + extraConfigFile 'ca.crt', file('src/javaRestTest/resources/ssl/ca.crt') + extraConfigFile 'roles.yml', file('src/javaRestTest/resources/roles.yml') user username: "admin_user", password: "admin-password" user username: "security_test_user", password: "security-test-password", role: "security_test_role" restart() } - nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.integTest.getAllHttpSocketURI().join(",")}" + nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.javaRestTest.getAllHttpSocketURI().join(",")}" } } -tasks.named("check").configure { dependsOn(integTestSecurity) } +tasks.named("check").configure { dependsOn(javaRestTestWithSecurity) } diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/roles.yml b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/roles.yml similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/roles.yml rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/roles.yml diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/README.asciidoc b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/README.asciidoc similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/README.asciidoc rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/README.asciidoc diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/ca.crt b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/ca.crt similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/ca.crt rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/ca.crt diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/ca.key b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/ca.key similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/ca.key rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/ca.key diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/transport.crt b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/transport.crt similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/transport.crt rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/transport.crt diff --git a/x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/transport.key b/x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/transport.key similarity index 100% rename from x-pack/plugin/security/qa/basic-enable-security/src/test/resources/ssl/transport.key rename to x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/resources/ssl/transport.key diff --git a/x-pack/plugin/security/qa/security-basic/build.gradle b/x-pack/plugin/security/qa/security-basic/build.gradle index fa5426eb3e633..cc7aae881094b 100644 --- a/x-pack/plugin/security/qa/security-basic/build.gradle +++ b/x-pack/plugin/security/qa/security-basic/build.gradle @@ -1,14 +1,13 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' + +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' numberOfNodes = 2 @@ -21,7 +20,7 @@ testClusters.integTest { setting 'xpack.security.authc.token.enabled', 'true' setting 'xpack.security.authc.api_key.enabled', 'true' - extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') + extraConfigFile 'roles.yml', file('src/javaRestTest/resources/roles.yml') user username: "admin_user", password: "admin-password" user username: "security_test_user", password: "security-test-password", role: "security_test_role" } diff --git a/x-pack/plugin/security/qa/security-basic/src/test/java/org/elasticsearch/xpack/security/SecurityInBasicRestTestCase.java b/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityInBasicRestTestCase.java similarity index 100% rename from x-pack/plugin/security/qa/security-basic/src/test/java/org/elasticsearch/xpack/security/SecurityInBasicRestTestCase.java rename to x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityInBasicRestTestCase.java diff --git a/x-pack/plugin/security/qa/security-basic/src/test/java/org/elasticsearch/xpack/security/SecurityWithBasicLicenseIT.java b/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityWithBasicLicenseIT.java similarity index 100% rename from x-pack/plugin/security/qa/security-basic/src/test/java/org/elasticsearch/xpack/security/SecurityWithBasicLicenseIT.java rename to x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityWithBasicLicenseIT.java diff --git a/x-pack/plugin/security/qa/security-basic/src/test/resources/roles.yml b/x-pack/plugin/security/qa/security-basic/src/javaRestTest/resources/roles.yml similarity index 100% rename from x-pack/plugin/security/qa/security-basic/src/test/resources/roles.yml rename to x-pack/plugin/security/qa/security-basic/src/javaRestTest/resources/roles.yml diff --git a/x-pack/plugin/security/qa/security-disabled/build.gradle b/x-pack/plugin/security/qa/security-disabled/build.gradle index c52dfb2728705..ff25b3667c495 100644 --- a/x-pack/plugin/security/qa/security-disabled/build.gradle +++ b/x-pack/plugin/security/qa/security-disabled/build.gradle @@ -6,17 +6,15 @@ * defined, it should be not fail */ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' numberOfNodes = 2 diff --git a/x-pack/plugin/security/qa/security-disabled/src/test/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityDisabledIT.java b/x-pack/plugin/security/qa/security-disabled/src/javaRestTest/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityDisabledIT.java similarity index 100% rename from x-pack/plugin/security/qa/security-disabled/src/test/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityDisabledIT.java rename to x-pack/plugin/security/qa/security-disabled/src/javaRestTest/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityDisabledIT.java diff --git a/x-pack/plugin/security/qa/security-not-enabled/build.gradle b/x-pack/plugin/security/qa/security-not-enabled/build.gradle index 5488bbf5cca97..6b1f8264105f2 100644 --- a/x-pack/plugin/security/qa/security-not-enabled/build.gradle +++ b/x-pack/plugin/security/qa/security-not-enabled/build.gradle @@ -6,17 +6,15 @@ * defined, it should be not fail */ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' numberOfNodes = 2 diff --git a/x-pack/plugin/security/qa/security-not-enabled/src/test/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityNotEnabledIT.java b/x-pack/plugin/security/qa/security-not-enabled/src/javaRestTest/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityNotEnabledIT.java similarity index 100% rename from x-pack/plugin/security/qa/security-not-enabled/src/test/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityNotEnabledIT.java rename to x-pack/plugin/security/qa/security-not-enabled/src/javaRestTest/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityNotEnabledIT.java diff --git a/x-pack/plugin/security/qa/security-trial/build.gradle b/x-pack/plugin/security/qa/security-trial/build.gradle index 1ffb181c4416f..d95be17c2d68b 100644 --- a/x-pack/plugin/security/qa/security-trial/build.gradle +++ b/x-pack/plugin/security/qa/security-trial/build.gradle @@ -1,14 +1,12 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'DEFAULT' numberOfNodes = 2 @@ -21,7 +19,7 @@ testClusters.integTest { setting 'xpack.security.authc.token.enabled', 'true' setting 'xpack.security.authc.api_key.enabled', 'true' - extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') + extraConfigFile 'roles.yml', file('src/javaRestTest/resources/roles.yml') user username: "admin_user", password: "admin-password" user username: "security_test_user", password: "security-test-password", role: "security_test_role" } diff --git a/x-pack/plugin/security/qa/security-trial/src/test/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java similarity index 100% rename from x-pack/plugin/security/qa/security-trial/src/test/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java rename to x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java diff --git a/x-pack/plugin/security/qa/security-trial/src/test/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java similarity index 100% rename from x-pack/plugin/security/qa/security-trial/src/test/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java rename to x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java diff --git a/x-pack/plugin/security/qa/security-trial/src/test/resources/roles.yml b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/resources/roles.yml similarity index 100% rename from x-pack/plugin/security/qa/security-trial/src/test/resources/roles.yml rename to x-pack/plugin/security/qa/security-trial/src/javaRestTest/resources/roles.yml diff --git a/x-pack/plugin/security/qa/tls-basic/build.gradle b/x-pack/plugin/security/qa/tls-basic/build.gradle index d5fc9c20ee186..7da9798194e1f 100644 --- a/x-pack/plugin/security/qa/tls-basic/build.gradle +++ b/x-pack/plugin/security/qa/tls-basic/build.gradle @@ -1,6 +1,4 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { testImplementation project(path: xpackModule('core'), configuration: 'default') @@ -8,21 +6,15 @@ dependencies { testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.p12' -} - - -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'DEFAULT' numberOfNodes = 2 - extraConfigFile 'http.key', file('src/test/resources/ssl/http.key') - extraConfigFile 'http.crt', file('src/test/resources/ssl/http.crt') - extraConfigFile 'transport.key', file('src/test/resources/ssl/transport.key') - extraConfigFile 'transport.crt', file('src/test/resources/ssl/transport.crt') - extraConfigFile 'ca.crt', file('src/test/resources/ssl/ca.crt') + extraConfigFile 'http.key', file('src/javaRestTest/resources/ssl/http.key') + extraConfigFile 'http.crt', file('src/javaRestTest/resources/ssl/http.crt') + extraConfigFile 'transport.key', file('src/javaRestTest/resources/ssl/transport.key') + extraConfigFile 'transport.crt', file('src/javaRestTest/resources/ssl/transport.crt') + extraConfigFile 'ca.crt', file('src/javaRestTest/resources/ssl/ca.crt') setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'basic' diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/java/org/elasticsearch/xpack/security/TlsWithBasicLicenseIT.java b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/TlsWithBasicLicenseIT.java similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/java/org/elasticsearch/xpack/security/TlsWithBasicLicenseIT.java rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/TlsWithBasicLicenseIT.java diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/README.asciidoc b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/README.asciidoc similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/README.asciidoc rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/README.asciidoc diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.crt b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.crt similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.crt rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.crt diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.key b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.key similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.key rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.key diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.p12 b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.p12 similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/ca.p12 rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/ca.p12 diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/http.crt b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/http.crt similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/http.crt rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/http.crt diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/http.key b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/http.key similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/http.key rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/http.key diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/transport.crt b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/transport.crt similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/transport.crt rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/transport.crt diff --git a/x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/transport.key b/x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/transport.key similarity index 100% rename from x-pack/plugin/security/qa/tls-basic/src/test/resources/ssl/transport.key rename to x-pack/plugin/security/qa/tls-basic/src/javaRestTest/resources/ssl/transport.key diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTestCase.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/AbstractPrivilegeTestCase.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/AbstractPrivilegeTestCase.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/AbstractPrivilegeTestCase.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClearRealmsCacheTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClearRealmsCacheTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClearRolesCacheTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClearRolesCacheTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/CreateDocsIndexPrivilegeTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/CreateDocsIndexPrivilegeTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/CreateDocsIndexPrivilegeTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/CreateDocsIndexPrivilegeTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityRandomTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityRandomTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityRandomTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityRandomTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/FieldLevelSecurityRandomTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityRandomTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/FieldLevelSecurityRandomTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityRandomTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/FieldLevelSecurityTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/KibanaSystemRoleIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/KibanaSystemRoleIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/KibanaSystemRoleIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/KibanaSystemRoleIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java similarity index 99% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java index 2fcce3e7f6027..bb26a95eaf508 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java @@ -162,6 +162,7 @@ public void testGetMappings() throws Exception { MappingMetadata mappingMetadata = mappingsMap.get(index).get(type); assertThat(mappingMetadata.getSourceAsMap(), hasKey("properties")); assertThat(mappingMetadata.getSourceAsMap().get("properties"), instanceOf(Map.class)); + @SuppressWarnings("unchecked") Map propertiesMap = (Map) mappingMetadata.getSourceAsMap().get("properties"); assertThat(propertiesMap, hasKey(field)); } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/PermissionPrecedenceTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/PermissionPrecedenceTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/PermissionPrecedenceTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/SecurityCachePermissionTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityCachePermissionTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/SecurityCachePermissionTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityCachePermissionTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/SecurityClearScrollTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/SecurityClearScrollTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/license/LicensingTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/license/LicensingTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/NativeRealmIntegTestCase.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/NativeRealmIntegTestCase.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/test/NativeRealmIntegTestCase.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/NativeRealmIntegTestCase.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java similarity index 97% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java index 233f80db6d5ca..f9ea04cfa6020 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java @@ -22,6 +22,7 @@ protected Settings transportClientSettings() { public void testSecurityServerTransportServiceWrapsAllHandlers() { for (TransportService transportService : internalCluster().getInstances(TransportService.class)) { + @SuppressWarnings("rawtypes") RequestHandlerRegistry handler = transportService.transport.getRequestHandlers() .getHandler(TransportService.HANDSHAKE_ACTION_NAME); assertEquals( diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ScrollHelperIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/ScrollHelperIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ScrollHelperIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/ScrollHelperIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityPluginTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/SecurityPluginTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityPluginTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/SecurityPluginTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/TemplateUpgraderTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/TemplateUpgraderTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/TemplateUpgraderTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/TemplateUpgraderTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/filter/DestructiveOperationsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/action/filter/DestructiveOperationsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/filter/DestructiveOperationsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/action/filter/DestructiveOperationsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java similarity index 99% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java index ec8c662bf049a..0d4dbc343bd35 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java @@ -571,6 +571,7 @@ public void testGetApiKeysForApiKeyName() throws InterruptedException, Execution Client client = client().filterWithHeader(headers); SecurityClient securityClient = new SecurityClient(client); PlainActionFuture listener = new PlainActionFuture<>(); + @SuppressWarnings("unchecked") List responses = randomFrom(createApiKeyResponses1, createApiKeyResponses2); securityClient.getApiKey(GetApiKeyRequest.usingApiKeyName(responses.get(0).getName(), false), listener); verifyGetResponse(1, responses, listener.get(), Collections.singleton(responses.get(0).getId()), null); @@ -651,6 +652,7 @@ public void testGetApiKeysOwnedByRunAsUserWillNotWorkWhenAuthUserInfoIsGiven() t final List userWithManageOwnApiKeyRoleApiKeys = createApiKeys("user_with_manage_own_api_key_role", "user_with_run_as_role", noOfApiKeysForUserWithManageApiKeyRole, null, "monitor"); PlainActionFuture listener = new PlainActionFuture<>(); + @SuppressWarnings("unchecked") final Tuple invalidRealmAndUserPair = randomFrom( new Tuple<>("file", "user_with_run_as_role"), new Tuple<>("index", "user_with_manage_own_api_key_role"), @@ -761,6 +763,7 @@ public void testInvalidateApiKeysOwnedByRunAsUserWillNotWorkWhenAuthUserInfoIsGi List userWithManageApiKeyRoleApiKeys = createApiKeys("user_with_manage_own_api_key_role", "user_with_run_as_role", noOfApiKeysForUserWithManageApiKeyRole, null, "monitor"); PlainActionFuture listener = new PlainActionFuture<>(); + @SuppressWarnings("unchecked") final Tuple invalidRealmAndUserPair = randomFrom( new Tuple<>("file", "user_with_run_as_role"), new Tuple<>("index", "user_with_manage_own_api_key_role"), diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RunAsIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/RunAsIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RunAsIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/RunAsIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/SecurityRealmSettingsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/SecurityRealmSettingsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/SecurityRealmSettingsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/SecurityRealmSettingsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java similarity index 99% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java index ea55c822f76a3..8b18e7b86ef09 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java @@ -534,6 +534,7 @@ public void testRefreshingMultipleTimesFails() throws Exception { .setFetchSource("refresh_token", Strings.EMPTY_STRING) .get(); assertNotNull(updateResponse); + @SuppressWarnings("unchecked") Map refreshTokenMap = (Map) updateResponse.getGetResult().sourceAsMap().get("refresh_token"); assertTrue( Instant.ofEpochMilli((long) refreshTokenMap.get("refresh_time")).isBefore(Instant.now().minus(30L, ChronoUnit.SECONDS))); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java similarity index 99% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java index 3bc220d6a689a..21f0d1403daf9 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java @@ -753,6 +753,7 @@ public void testRolesUsageStats() throws Exception { assertThat(usage.get("dls"), is(dls)); } + @SuppressWarnings("unchecked") public void testRealmUsageStats() { final int numNativeUsers = scaledRandomIntBetween(1, 32); SecurityClient securityClient = new SecurityClient(client()); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AnalyzeTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/AnalyzeTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AnalyzeTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/AnalyzeTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndexAliasesTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/IndexAliasesTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndexAliasesTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/IndexAliasesTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/ReadActionsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/ReadActionsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/ReadActionsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/ReadActionsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SecurityScrollTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SecurityScrollTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SecurityScrollTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SecurityScrollTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SecuritySearchOperationListenerTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SecuritySearchOperationListenerTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SecuritySearchOperationListenerTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SecuritySearchOperationListenerTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SnapshotUserRoleIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SnapshotUserRoleIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/SnapshotUserRoleIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/SnapshotUserRoleIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreCacheTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreCacheTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreCacheTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreCacheTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java similarity index 98% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java index d8282a3e75942..40b127eceab19 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java @@ -15,6 +15,7 @@ import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.transport.Transport; import org.elasticsearch.xpack.core.common.socket.SocketAccess; +import org.elasticsearch.xpack.security.transport.filter.IPFilter; import org.junit.BeforeClass; import java.io.IOException; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java similarity index 99% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java index e75b0d1a2b49b..fd91455023b11 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java @@ -9,6 +9,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.SecurityIntegTestCase; +import org.elasticsearch.xpack.security.transport.filter.IPFilter; import org.junit.BeforeClass; import java.net.InetAddress; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ssl/EllipticCurveSSLTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/EllipticCurveSSLTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ssl/EllipticCurveSSLTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/EllipticCurveSSLTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ssl/SslIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/SslIntegrationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ssl/SslIntegrationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/SslIntegrationTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/user/AnonymousUserIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/user/AnonymousUserIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/user/AnonymousUserIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/user/AnonymousUserIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadDuringStartupIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLReloadDuringStartupIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadDuringStartupIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLReloadDuringStartupIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java diff --git a/x-pack/plugin/spatial/build.gradle b/x-pack/plugin/spatial/build.gradle index 9566e92015541..0539e6cee4284 100644 --- a/x-pack/plugin/spatial/build.gradle +++ b/x-pack/plugin/spatial/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.yaml-rest-test' esplugin { name 'spatial' @@ -11,6 +12,7 @@ esplugin { dependencies { compileOnly project(path: xpackModule('core'), configuration: 'default') testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + yamlRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') api project(path: ':modules:geo', configuration: 'default') restTestConfig project(path: ':modules:geo', configuration: 'restTests') } @@ -24,7 +26,7 @@ restResources { } } -testClusters.integTest { +testClusters.all { setting 'xpack.license.self_generated.type', 'trial' setting 'indices.breaker.request.limit', '25kb' testDistribution = 'DEFAULT' diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTests.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTests.java rename to x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTests.java diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/SpatialClientYamlTestSuiteIT.java b/x-pack/plugin/spatial/src/yamlRestTest/java/org/elasticsearch/xpack/spatial/SpatialClientYamlTestSuiteIT.java similarity index 100% rename from x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/SpatialClientYamlTestSuiteIT.java rename to x-pack/plugin/spatial/src/yamlRestTest/java/org/elasticsearch/xpack/spatial/SpatialClientYamlTestSuiteIT.java diff --git a/x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/10_geo_bounds.yml b/x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/10_geo_bounds.yml similarity index 100% rename from x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/10_geo_bounds.yml rename to x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/10_geo_bounds.yml diff --git a/x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/20_geo_centroid.yml b/x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/20_geo_centroid.yml similarity index 100% rename from x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/20_geo_centroid.yml rename to x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/20_geo_centroid.yml diff --git a/x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/30_geotile_grid.yml b/x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/30_geotile_grid.yml similarity index 100% rename from x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/30_geotile_grid.yml rename to x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/30_geotile_grid.yml diff --git a/x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/40_geohash_grid.yml b/x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/40_geohash_grid.yml similarity index 100% rename from x-pack/plugin/spatial/src/test/resources/rest-api-spec/test/40_geohash_grid.yml rename to x-pack/plugin/spatial/src/yamlRestTest/resources/rest-api-spec/test/40_geohash_grid.yml diff --git a/x-pack/plugin/stack/qa/rest/build.gradle b/x-pack/plugin/stack/qa/rest/build.gradle index dfa43ed04442c..e341cbf957c8e 100644 --- a/x-pack/plugin/stack/qa/rest/build.gradle +++ b/x-pack/plugin/stack/qa/rest/build.gradle @@ -1,12 +1,7 @@ -import org.elasticsearch.gradle.test.RestIntegTestTask - -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-test' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') - testImplementation project(xpackModule('stack')) + yamlRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } restResources { @@ -19,19 +14,15 @@ restResources { def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] -task restTest(type: RestIntegTestTask) { - mustRunAfter(precommit) +yamlRestTest { systemProperty 'tests.rest.cluster.username', clusterCredentials.username systemProperty 'tests.rest.cluster.password', clusterCredentials.password } -testClusters.restTest { +testClusters.all { testDistribution = 'DEFAULT' setting 'xpack.ml.enabled', 'false' setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' user clusterCredentials } - -check.dependsOn restTest -test.enabled = false diff --git a/x-pack/plugin/stack/qa/rest/src/test/java/org/elasticsearch/xpack/stack/StackYamlIT.java b/x-pack/plugin/stack/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/stack/StackYamlIT.java similarity index 100% rename from x-pack/plugin/stack/qa/rest/src/test/java/org/elasticsearch/xpack/stack/StackYamlIT.java rename to x-pack/plugin/stack/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/stack/StackYamlIT.java diff --git a/x-pack/plugin/stack/qa/rest/src/test/resources/rest-api-spec/test/stack/10_basic.yml b/x-pack/plugin/stack/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/stack/10_basic.yml similarity index 100% rename from x-pack/plugin/stack/qa/rest/src/test/resources/rest-api-spec/test/stack/10_basic.yml rename to x-pack/plugin/stack/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/stack/10_basic.yml diff --git a/x-pack/plugin/transform/build.gradle b/x-pack/plugin/transform/build.gradle index 0c527f6ac3ed7..988d1cf6e9a49 100644 --- a/x-pack/plugin/transform/build.gradle +++ b/x-pack/plugin/transform/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'transform' description 'A plugin to transform data' diff --git a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle index 33e4dc540c65a..a8df3ece05651 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle @@ -1,11 +1,9 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') - testImplementation project(xpackModule('transform')) + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('transform')) testImplementation project(':client:rest-high-level') } @@ -22,11 +20,11 @@ tasks.register("copyKeyCerts", Copy) { } // Add keys and cets to test classpath: it expects it there sourceSets.test.resources.srcDir(keystoreDir) -tasks.named("processTestResources").configure { dependsOn("copyKeyCerts") } +tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts") } -tasks.named("integTest").configure { dependsOn "copyKeyCerts" } +tasks.named("javaRestTest").configure { dependsOn "copyKeyCerts" } -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'DEFAULT' setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformIT.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java similarity index 100% rename from x-pack/plugin/transform/qa/multi-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformIT.java rename to x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java similarity index 100% rename from x-pack/plugin/transform/qa/multi-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java rename to x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/build.gradle b/x-pack/plugin/transform/qa/single-node-tests/build.gradle index 4cb27bc9a0a4e..5c2dd0686cf89 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/single-node-tests/build.gradle @@ -1,15 +1,14 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' + +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(path: xpackModule('core'), configuration: 'default') - testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') - testImplementation project(xpackModule('transform')) + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default') + javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') + javaRestTestImplementation project(path: xpackModule('transform')) testImplementation project(':client:rest-high-level') } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformAuditorIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformAuditorIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformAuditorIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformAuditorIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformMetadataIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformMetadataIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformMetadataIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformMetadataIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformUpdateIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUpdateIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformUpdateIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUpdateIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/DateHistogramGroupByIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/DateHistogramGroupByIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/DateHistogramGroupByIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/DateHistogramGroupByIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/TermsGroupByIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TermsGroupByIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/TermsGroupByIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TermsGroupByIT.java diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java similarity index 100% rename from x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java rename to x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformSingleNodeTestCase.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/TransformSingleNodeTestCase.java similarity index 100% rename from x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformSingleNodeTestCase.java rename to x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/TransformSingleNodeTestCase.java diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/checkpoint/TransformCheckpointServiceNodeTests.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformCheckpointServiceNodeTests.java similarity index 100% rename from x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/checkpoint/TransformCheckpointServiceNodeTests.java rename to x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformCheckpointServiceNodeTests.java diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java similarity index 100% rename from x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java rename to x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java diff --git a/x-pack/plugin/vectors/build.gradle b/x-pack/plugin/vectors/build.gradle index b41425ae91902..ffaf25c4945e9 100644 --- a/x-pack/plugin/vectors/build.gradle +++ b/x-pack/plugin/vectors/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'vectors' diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java similarity index 100% rename from x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java rename to x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java similarity index 100% rename from x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java rename to x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java diff --git a/x-pack/plugin/voting-only-node/build.gradle b/x-pack/plugin/voting-only-node/build.gradle index a12eaf4c580b3..1bbe42bc426dc 100644 --- a/x-pack/plugin/voting-only-node/build.gradle +++ b/x-pack/plugin/voting-only-node/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-voting-only-node' description 'Elasticsearch Expanded Pack Plugin - Voting-only node' diff --git a/x-pack/plugin/voting-only-node/src/test/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePluginTests.java b/x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePluginTests.java similarity index 100% rename from x-pack/plugin/voting-only-node/src/test/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePluginTests.java rename to x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePluginTests.java diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index 7355eb37d5759..b19c5c73ee96f 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -1,6 +1,7 @@ import org.elasticsearch.gradle.info.BuildParams apply plugin: 'elasticsearch.esplugin' +apply plugin: 'elasticsearch.internal-cluster-test' esplugin { name 'x-pack-watcher' description 'Elasticsearch Expanded Pack Plugin - Watcher' @@ -122,7 +123,7 @@ if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { ) } -test { +internalClusterTest { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. diff --git a/x-pack/plugin/watcher/qa/common/build.gradle b/x-pack/plugin/watcher/qa/common/build.gradle new file mode 100644 index 0000000000000..fca0d41407fd5 --- /dev/null +++ b/x-pack/plugin/watcher/qa/common/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'elasticsearch.build' +test.enabled = false + +dependencies { + implementation project(':test:framework') +} + diff --git a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java b/x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java similarity index 75% rename from x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java rename to x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java index 8a1126c43c6cf..42c6a4b6ecb81 100644 --- a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java +++ b/x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java @@ -7,15 +7,16 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; +import org.hamcrest.Matchers; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import java.util.concurrent.TimeUnit; -import static org.hamcrest.Matchers.is; - /** * Parent test class for Watcher (not-YAML) based REST tests */ @@ -23,15 +24,15 @@ public abstract class WatcherRestTestCase extends ESRestTestCase { @Before public final void startWatcher() throws Exception { - assertBusy(() -> { - Response response = adminClient().performRequest(new Request("GET", "/_watcher/stats")); + ESTestCase.assertBusy(() -> { + Response response = ESRestTestCase.adminClient().performRequest(new Request("GET", "/_watcher/stats")); String state = ObjectPath.createFromResponse(response).evaluate("stats.0.watcher_state"); switch (state) { case "stopped": - Response startResponse = adminClient().performRequest(new Request("POST", "/_watcher/_start")); + Response startResponse = ESRestTestCase.adminClient().performRequest(new Request("POST", "/_watcher/_start")); boolean isAcknowledged = ObjectPath.createFromResponse(startResponse).evaluate("acknowledged"); - assertThat(isAcknowledged, is(true)); + Assert.assertThat(isAcknowledged, Matchers.is(true)); throw new AssertionError("waiting until stopped state reached started state"); case "stopping": throw new AssertionError("waiting until stopping state reached stopped state to start again"); @@ -48,8 +49,8 @@ public final void startWatcher() throws Exception { @After public final void stopWatcher() throws Exception { - assertBusy(() -> { - Response response = adminClient().performRequest(new Request("GET", "/_watcher/stats")); + ESTestCase.assertBusy(() -> { + Response response = ESRestTestCase.adminClient().performRequest(new Request("GET", "/_watcher/stats")); String state = ObjectPath.createFromResponse(response).evaluate("stats.0.watcher_state"); switch (state) { @@ -61,9 +62,9 @@ public final void stopWatcher() throws Exception { case "starting": throw new AssertionError("waiting until starting state reached started state to stop"); case "started": - Response stopResponse = adminClient().performRequest(new Request("POST", "/_watcher/_stop")); + Response stopResponse = ESRestTestCase.adminClient().performRequest(new Request("POST", "/_watcher/_stop")); boolean isAcknowledged = ObjectPath.createFromResponse(stopResponse).evaluate("acknowledged"); - assertThat(isAcknowledged, is(true)); + Assert.assertThat(isAcknowledged, Matchers.is(true)); throw new AssertionError("waiting until started state reached stopped state"); default: throw new AssertionError("unknown state[" + state + "]"); @@ -72,10 +73,10 @@ public final void stopWatcher() throws Exception { Request deleteWatchesIndexRequest = new Request("DELETE", ".watches"); deleteWatchesIndexRequest.addParameter("ignore_unavailable", "true"); - adminClient().performRequest(deleteWatchesIndexRequest); + ESRestTestCase.adminClient().performRequest(deleteWatchesIndexRequest); Request deleteWatchHistoryRequest = new Request("DELETE", ".watcher-history-*"); deleteWatchHistoryRequest.addParameter("ignore_unavailable", "true"); - adminClient().performRequest(deleteWatchHistoryRequest); + ESRestTestCase.adminClient().performRequest(deleteWatchHistoryRequest); } } diff --git a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java b/x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java similarity index 74% rename from x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java rename to x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java index 7dd064f7dbc91..d41579230d95f 100644 --- a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java +++ b/x-pack/plugin/watcher/qa/common/src/main/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java @@ -8,10 +8,14 @@ import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.elasticsearch.client.Request; +import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ClientYamlTestResponse; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.hamcrest.Matchers; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import java.io.IOException; @@ -19,7 +23,6 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; -import static org.hamcrest.Matchers.is; /** * Parent test class for Watcher YAML based REST tests @@ -36,17 +39,20 @@ public static Iterable parameters() throws Exception { @Before public final void startWatcher() throws Exception { - assertBusy(() -> { - ClientYamlTestResponse response = - getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap()); + ESTestCase.assertBusy(() -> { + ClientYamlTestResponse response = getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap()); String state = (String) response.evaluate("stats.0.watcher_state"); switch (state) { case "stopped": - ClientYamlTestResponse startResponse = - getAdminExecutionContext().callApi("watcher.start", emptyMap(), emptyList(), emptyMap()); + ClientYamlTestResponse startResponse = getAdminExecutionContext().callApi( + "watcher.start", + emptyMap(), + emptyList(), + emptyMap() + ); boolean isAcknowledged = (boolean) startResponse.evaluate("acknowledged"); - assertThat(isAcknowledged, is(true)); + Assert.assertThat(isAcknowledged, Matchers.is(true)); throw new AssertionError("waiting until stopped state reached started state"); case "stopping": throw new AssertionError("waiting until stopping state reached stopped state to start again"); @@ -66,12 +72,10 @@ public final void startWatcher() throws Exception { }); } - @After public final void stopWatcher() throws Exception { - assertBusy(() -> { - ClientYamlTestResponse response = - getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap()); + ESTestCase.assertBusy(() -> { + ClientYamlTestResponse response = getAdminExecutionContext().callApi("watcher.stats", emptyMap(), emptyList(), emptyMap()); String state = (String) response.evaluate("stats.0.watcher_state"); switch (state) { case "stopped": @@ -82,10 +86,14 @@ public final void stopWatcher() throws Exception { case "starting": throw new AssertionError("waiting until starting state reached started state to stop"); case "started": - ClientYamlTestResponse stopResponse = - getAdminExecutionContext().callApi("watcher.stop", emptyMap(), emptyList(), emptyMap()); + ClientYamlTestResponse stopResponse = getAdminExecutionContext().callApi( + "watcher.stop", + emptyMap(), + emptyList(), + emptyMap() + ); boolean isAcknowledged = (boolean) stopResponse.evaluate("acknowledged"); - assertThat(isAcknowledged, is(true)); + Assert.assertThat(isAcknowledged, Matchers.is(true)); throw new AssertionError("waiting until started state reached stopped state"); default: throw new AssertionError("unknown state[" + state + "]"); @@ -97,12 +105,10 @@ public final void stopWatcher() throws Exception { private static void deleteWatcherIndices() throws IOException { Request deleteWatchesIndexRequest = new Request("DELETE", ".watches"); deleteWatchesIndexRequest.addParameter("ignore_unavailable", "true"); - adminClient().performRequest(deleteWatchesIndexRequest); + ESRestTestCase.adminClient().performRequest(deleteWatchesIndexRequest); Request deleteWatchHistoryRequest = new Request("DELETE", ".watcher-history-*"); deleteWatchHistoryRequest.addParameter("ignore_unavailable", "true"); - adminClient().performRequest(deleteWatchHistoryRequest); + ESRestTestCase.adminClient().performRequest(deleteWatchHistoryRequest); } } - - diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index f26d6f376b7d0..00a7d1925ab30 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -1,25 +1,14 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(':x-pack:qa') -} - -configurations { - testArtifacts.extendsFrom testRuntime - testArtifacts.extendsFrom testImplementation -} - -def testJar = tasks.register("testJar", Jar) { - appendix 'test' - from sourceSets.test.output + yamlRestTestImplementation project(path: ':x-pack:plugin:watcher:qa:common') + javaRestTestImplementation project(path: ':x-pack:plugin:watcher:qa:common') + javaRestTestImplementation project(':x-pack:qa') } artifacts { - testArtifacts testJar - restXpackTests(new File(projectDir, "src/test/resources/rest-api-spec/test")) + restXpackTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test")) } restResources { @@ -30,7 +19,7 @@ restResources { } } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' setting 'xpack.security.enabled', 'false' setting 'xpack.ml.enabled', 'false' diff --git a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java b/x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java rename to x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java diff --git a/x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/smoketest/WatcherYamlRestIT.java b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/java/org/elasticsearch/smoketest/WatcherYamlRestIT.java similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/java/org/elasticsearch/smoketest/WatcherYamlRestIT.java rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/java/org/elasticsearch/smoketest/WatcherYamlRestIT.java diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/10_webhook.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/10_webhook.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/10_webhook.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/10_webhook.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/20_array_access.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/20_array_access.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/20_array_access.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/20_array_access.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/25_array_compare.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/25_array_compare.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/25_array_compare.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/25_array_compare.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/30_search_input.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/30_search_input.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/40_search_transform.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/40_search_transform.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/50_webhook_url_escaping.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/50_webhook_url_escaping.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/mustache/50_webhook_url_escaping.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/50_webhook_url_escaping.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/20_minimal_body.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/20_minimal_body.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/20_minimal_body.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/20_minimal_body.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/30_inline_watch.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/30_inline_watch.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/30_inline_watch.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/30_inline_watch.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/40_exception.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/40_exception.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/40_exception.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/40_exception.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/50_update_scripts.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/50_update_scripts.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/50_update_scripts.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/50_update_scripts.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/60_chain_input_with_transform.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/60_chain_input_with_transform.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/painless/60_chain_input_with_transform.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/painless/60_chain_input_with_transform.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/20_ack_individual_action.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/20_ack_individual_action.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/20_ack_individual_action.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/20_ack_individual_action.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/30_reset_ack_after_unmet_condition.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/30_reset_ack_after_unmet_condition.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/30_reset_ack_after_unmet_condition.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/30_reset_ack_after_unmet_condition.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/40_reset_ack_after_unmet_action_condition.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/40_reset_ack_after_unmet_action_condition.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/ack_watch/40_reset_ack_after_unmet_action_condition.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/ack_watch/40_reset_ack_after_unmet_action_condition.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/activate_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/activate_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/activate_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/activate_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/delete_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/delete_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/delete_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/delete_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/20_transform.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/20_transform.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/20_transform.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/20_transform.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/30_throttled.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/30_throttled.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/30_throttled.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/30_throttled.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/40_ignore_condition.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/40_ignore_condition.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/40_ignore_condition.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/40_ignore_condition.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/50_action_mode.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/50_action_mode.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/50_action_mode.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/50_action_mode.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/60_http_input.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/60_http_input.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/60_http_input.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/60_http_input.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/70_invalid.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/70_invalid.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/70_invalid.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/70_invalid.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/80_foreach.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/80_foreach.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/execute_watch/80_foreach.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/execute_watch/80_foreach.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/20_missing.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/20_missing.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/20_missing.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/20_missing.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/30_with_chain_input.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/30_with_chain_input.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/get_watch/30_with_chain_input.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/get_watch/30_with_chain_input.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/20_put_watch_with_throttle_period.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/20_put_watch_with_throttle_period.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/20_put_watch_with_throttle_period.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/20_put_watch_with_throttle_period.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/30_put_watch_with_action_throttle_period.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/30_put_watch_with_action_throttle_period.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/30_put_watch_with_action_throttle_period.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/30_put_watch_with_action_throttle_period.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/40_put_watch_as_inactive.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/40_put_watch_as_inactive.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/40_put_watch_as_inactive.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/40_put_watch_as_inactive.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/50_email_attachment_validation.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/50_email_attachment_validation.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/50_email_attachment_validation.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/50_email_attachment_validation.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/60_put_watch_with_action_condition.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/60_put_watch_with_action_condition.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/60_put_watch_with_action_condition.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/60_put_watch_with_action_condition.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/70_put_watch_with_index_action_using_id.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/70_put_watch_with_index_action_using_id.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/70_put_watch_with_index_action_using_id.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/70_put_watch_with_index_action_using_id.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/80_put_get_watch_with_passwords.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/80_put_get_watch_with_passwords.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/80_put_get_watch_with_passwords.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/80_put_get_watch_with_passwords.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/90_ensure_watch_gets_overwritten_without_version.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_ensure_watch_gets_overwritten_without_version.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/90_ensure_watch_gets_overwritten_without_version.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_ensure_watch_gets_overwritten_without_version.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/91_search_total_hits_as_int.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/91_search_total_hits_as_int.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/put_watch/91_search_total_hits_as_int.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/91_search_total_hits_as_int.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/start_watcher/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/start_watcher/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/start_watcher/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/start_watcher/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/stats/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/stats/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/stats/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/stats/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/stop_watcher/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/stop_watcher/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/stop_watcher/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/stop_watcher/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/usage/10_basic.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/usage/10_basic.yml similarity index 100% rename from x-pack/plugin/watcher/qa/rest/src/test/resources/rest-api-spec/test/watcher/usage/10_basic.yml rename to x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/usage/10_basic.yml diff --git a/x-pack/plugin/watcher/qa/with-monitoring/build.gradle b/x-pack/plugin/watcher/qa/with-monitoring/build.gradle index 4d95fbc1ad1b4..00c5e38aeac53 100644 --- a/x-pack/plugin/watcher/qa/with-monitoring/build.gradle +++ b/x-pack/plugin/watcher/qa/with-monitoring/build.gradle @@ -1,12 +1,10 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(':x-pack:qa') + javaRestTestImplementation project(':x-pack:qa') } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' setting 'xpack.monitoring.collection.enabled', 'true' setting 'xpack.monitoring.collection.interval', '1s' diff --git a/x-pack/plugin/watcher/qa/with-monitoring/src/test/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java b/x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java similarity index 100% rename from x-pack/plugin/watcher/qa/with-monitoring/src/test/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java rename to x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java diff --git a/x-pack/plugin/watcher/qa/with-security/build.gradle b/x-pack/plugin/watcher/qa/with-security/build.gradle index 1f467979c2af6..bb1334ddc4444 100644 --- a/x-pack/plugin/watcher/qa/with-security/build.gradle +++ b/x-pack/plugin/watcher/qa/with-security/build.gradle @@ -1,11 +1,11 @@ -apply plugin: 'elasticsearch.testclusters' -apply plugin: 'elasticsearch.standalone-rest-test' -apply plugin: 'elasticsearch.rest-test' -apply plugin: 'elasticsearch.rest-resources' +apply plugin: 'elasticsearch.yaml-rest-test' +apply plugin: 'elasticsearch.java-rest-test' dependencies { - testImplementation project(':x-pack:qa') - testImplementation project(path: ':x-pack:plugin:watcher:qa:rest', configuration: 'testArtifacts') + yamlRestTestImplementation project(path: ':x-pack:plugin:watcher:qa:common') + javaRestTestImplementation project(path: ':x-pack:plugin:watcher:qa:common') + javaRestTestImplementation project(':x-pack:qa') + yamlRestTestImplementation project(':x-pack:qa') restXpackTestConfig project(path: ':x-pack:plugin:watcher:qa:rest', configuration: 'restXpackTests') } @@ -18,7 +18,7 @@ restResources { } } -testClusters.integTest { +testClusters.all { testDistribution = 'DEFAULT' setting 'xpack.ml.enabled', 'false' setting 'xpack.security.enabled', 'true' diff --git a/x-pack/plugin/watcher/qa/with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java b/x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java similarity index 100% rename from x-pack/plugin/watcher/qa/with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java rename to x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java diff --git a/x-pack/plugin/watcher/qa/with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java b/x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java similarity index 97% rename from x-pack/plugin/watcher/qa/with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java rename to x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java index 5bebf4ebc23d4..aa33800a2ab16 100644 --- a/x-pack/plugin/watcher/qa/with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java +++ b/x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java @@ -29,7 +29,7 @@ public SmokeTestWatcherWithSecurityClientYamlTestSuiteIT(@Name("yaml") ClientYam @ParametersFactory public static Iterable parameters() throws Exception { - return ESClientYamlSuiteTestCase.createParameters(); + return createParameters(); } @Before diff --git a/x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/10_insufficient_privs.yml b/x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/10_insufficient_privs.yml similarity index 100% rename from x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/10_insufficient_privs.yml rename to x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/10_insufficient_privs.yml diff --git a/x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/20_settings_filter.yml b/x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/20_settings_filter.yml similarity index 100% rename from x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/20_settings_filter.yml rename to x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/20_settings_filter.yml diff --git a/x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/20_test_run_as_execute_watch.yml b/x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/20_test_run_as_execute_watch.yml similarity index 100% rename from x-pack/plugin/watcher/qa/with-security/src/test/resources/rest-api-spec/test/watcher/security/20_test_run_as_execute_watch.yml rename to x-pack/plugin/watcher/qa/with-security/src/yamlRestTest/resources/rest-api-spec/test/watcher/security/20_test_run_as_execute_watch.yml diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherConcreteIndexTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/WatcherConcreteIndexTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherConcreteIndexTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/WatcherConcreteIndexTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecuteWatchQueuedStatsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/execution/ExecuteWatchQueuedStatsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecuteWatchQueuedStatsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/execution/ExecuteWatchQueuedStatsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryActionConditionTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryActionConditionTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryActionConditionTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryActionConditionTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java similarity index 99% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index a8e30b9d3aa6f..4a2781bcd2bf2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -33,7 +33,6 @@ import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockMustacheScriptEngine; -import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.ESIntegTestCase; @@ -108,8 +107,6 @@ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, maxNumDataNodes = 3) public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase { - public static final String WATCHER_LANG = Script.DEFAULT_SCRIPT_LANG; - private TimeWarp timeWarp; @Override @@ -359,6 +356,7 @@ private IndexNameExpressionResolver indexNameExpressionResolver() { return internalCluster().getInstance(IndexNameExpressionResolver.class); } + @SuppressWarnings("unchecked") protected void assertValue(XContentSource source, String path, Matcher matcher) { assertThat(source.getValue(path), (Matcher) matcher); } diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java similarity index 99% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java index 9b92294a07022..450467f0ae696 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java @@ -235,6 +235,7 @@ public void testVarsManual() throws Exception { } } + @SuppressWarnings("unchecked") private static void assertValue(Map map, String path, Matcher matcher) { assertThat(ObjectPath.eval(path, map), (Matcher) matcher); } diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java similarity index 99% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java index afb42c65b6be2..4d9b99dc32dcd 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java @@ -77,6 +77,7 @@ public void testFailedInputResultWithDotsInFieldNameGetsStored() throws Exceptio // The result of the search input will be a failure, because a missing index does not exist when // the query is executed + @SuppressWarnings({"rawtypes"}) Input.Builder input = searchInput(request); // wrapping this randomly into a chained input to test this as well boolean useChained = randomBoolean(); @@ -117,6 +118,7 @@ public void testFailedInputResultWithDotsInFieldNameGetsStored() throws Exceptio // See https://github.com/elastic/x-plugins/issues/2913 public void testPayloadInputWithDotsInFieldNameWorks() throws Exception { + @SuppressWarnings({"rawtypes"}) Input.Builder input = simpleInput("foo.bar", "bar"); // wrapping this randomly into a chained input to test this as well diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java index 9ed943596891c..6a31ef68525a8 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.io.Streams; +import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -18,6 +19,7 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.common.secret.Secret; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -43,7 +45,6 @@ import org.elasticsearch.xpack.watcher.notification.email.attachment.EmailAttachmentsParser; import org.elasticsearch.xpack.watcher.notification.email.attachment.HttpEmailAttachementParser; import org.elasticsearch.xpack.watcher.notification.email.attachment.HttpRequestAttachment; -import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.MockTextTemplateEngine; import org.junit.Before; @@ -55,6 +56,7 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; @@ -93,7 +95,7 @@ public void addEmailAttachmentParsers() { public void testExecute() throws Exception { final String account = "account1"; - EmailService service = new AbstractWatcherIntegrationTestCase.NoopEmailService(); + EmailService service = new NoopEmailService(); TextTemplateEngine engine = mock(TextTemplateEngine.class); HtmlSanitizer htmlSanitizer = mock(HtmlSanitizer.class); @@ -504,7 +506,7 @@ public void testThatDataAttachmentGetsAttachedWithId() throws Exception { } public void testThatOneFailedEmailAttachmentResultsInActionFailure() throws Exception { - EmailService emailService = new AbstractWatcherIntegrationTestCase.NoopEmailService(); + EmailService emailService = new NoopEmailService(); TextTemplateEngine engine = new MockTextTemplateEngine(); HttpClient httpClient = mock(HttpClient.class); @@ -560,7 +562,7 @@ public void testThatOneFailedEmailAttachmentResultsInActionFailure() throws Exce } private EmailActionFactory createEmailActionFactory() { - EmailService emailService = new AbstractWatcherIntegrationTestCase.NoopEmailService(); + EmailService emailService = new NoopEmailService(); TextTemplateEngine engine = mock(TextTemplateEngine.class); return new EmailActionFactory(Settings.EMPTY, emailService, engine, emailAttachmentParser); @@ -605,4 +607,18 @@ private EmailAttachments randomEmailAttachments() throws IOException { return new EmailAttachments(attachments); } + + public static class NoopEmailService extends EmailService { + + public NoopEmailService() { + super(Settings.EMPTY, null, mock(SSLService.class), + new ClusterSettings(Settings.EMPTY, new HashSet<>(EmailService.getSettings()))); + } + + @Override + public EmailSent send(Email email, Authentication auth, Profile profile, String accountName) { + return new EmailSent(accountName, email); + } + } + } diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java index 439eb45f0159f..22d6573ffb627 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java @@ -22,6 +22,7 @@ import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.core.watcher.watch.Watch; +import org.elasticsearch.xpack.watcher.actions.email.EmailActionTests; import org.elasticsearch.xpack.watcher.common.http.HttpClient; import org.elasticsearch.xpack.watcher.common.http.HttpMethod; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; @@ -33,7 +34,6 @@ import org.elasticsearch.xpack.watcher.execution.TriggeredExecutionContext; import org.elasticsearch.xpack.watcher.notification.email.Attachment; import org.elasticsearch.xpack.watcher.support.search.WatcherSearchTemplateService; -import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.MockTextTemplateEngine; import org.elasticsearch.xpack.watcher.test.WatcherTestUtils; import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleTriggerEvent; @@ -268,7 +268,7 @@ private Watch createWatch(String watchId) throws AddressException, IOException { return WatcherTestUtils.createTestWatch(watchId, mock(Client.class), ExecuteScenario.Success.client(), - new AbstractWatcherIntegrationTestCase.NoopEmailService(), + new EmailActionTests.NoopEmailService(), mock(WatcherSearchTemplateService.class), logger); } diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java index 70ca6bf1683c0..af71b0d7842b2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java @@ -31,7 +31,6 @@ import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; -import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.elasticsearch.xpack.watcher.test.WatcherMockScriptPlugin; import org.junit.Before; @@ -69,7 +68,7 @@ public void init() throws IOException { scripts.put("null.foo", s -> { throw new ScriptException("Error evaluating null.foo", new IllegalArgumentException(), emptyList(), - "null.foo", AbstractWatcherIntegrationTestCase.WATCHER_LANG); + "null.foo", Script.DEFAULT_SCRIPT_LANG); }); scripts.put("ctx.payload.hits.total.value > 1", vars -> {