From f6b3148e5e3758af3cf48fcb3cce9b55589c778b Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 2 Sep 2020 11:20:55 -0500 Subject: [PATCH] [7.x] Convert second 1/2 x-pack plugins from integTest to [yaml | java]RestTest or internalClusterTest (#61802) (#61856) For 1/2 the plugins in x-pack, the integTest task is now a no-op and all of the tests are now executed via a test, yamlRestTest, javaRestTest, or internalClusterTest. This includes the following projects: security, spatial, stack, transform, vecotrs, voting-only-node, and watcher. A few of the more specialized qa projects within these plugins have not been changed with this PR due to additional complexity which should be addressed separately. related: #60630 related: #56841 related: #59939 related: #55896 --- .../plugin/searchable-snapshots/build.gradle | 4 +- ...ableSnapshotsBlobStoreCacheIntegTests.java | 0 .../BaseSearchableSnapshotsIntegTestCase.java | 0 .../ClusterStateApplierOrderingTests.java | 0 .../LocalStateSearchableSnapshots.java | 0 ...SnapshotRecoveryStateIntegrationTests.java | 0 ...hableSnapshotsCacheClearingIntegTests.java | 0 .../SearchableSnapshotsIntegTests.java | 4 +- .../SearchableSnapshotsLicenseIntegTests.java | 0 ...archableSnapshotsPrewarmingIntegTests.java | 0 ...hableSnapshotsSystemIndicesIntegTests.java | 0 ...ableSnapshotsUuidValidationIntegTests.java | 0 x-pack/plugin/security/build.gradle | 10 ++++- .../qa/basic-enable-security/build.gradle | 40 ++++++++--------- .../EnableSecurityOnBasicLicenseIT.java | 0 .../resources/roles.yml | 0 .../resources/ssl/README.asciidoc | 0 .../resources/ssl/ca.crt | 0 .../resources/ssl/ca.key | 0 .../resources/ssl/transport.crt | 0 .../resources/ssl/transport.key | 0 .../security/qa/security-basic/build.gradle | 15 +++---- .../security/SecurityInBasicRestTestCase.java | 0 .../security/SecurityWithBasicLicenseIT.java | 0 .../resources/roles.yml | 0 .../qa/security-disabled/build.gradle | 12 +++-- ...tyUserProcessorWithSecurityDisabledIT.java | 0 .../qa/security-not-enabled/build.gradle | 12 +++-- ...UserProcessorWithSecurityNotEnabledIT.java | 0 .../security/qa/security-trial/build.gradle | 14 +++--- .../SecurityOnTrialLicenseRestTestCase.java | 0 .../xpack/security/apikey/ApiKeyRestIT.java | 0 .../resources/roles.yml | 0 .../plugin/security/qa/tls-basic/build.gradle | 22 +++------ .../xpack/security/TlsWithBasicLicenseIT.java | 0 .../resources/ssl/README.asciidoc | 0 .../resources/ssl/ca.crt | 0 .../resources/ssl/ca.key | 0 .../resources/ssl/ca.p12 | Bin .../resources/ssl/http.crt | 0 .../resources/ssl/http.key | 0 .../resources/ssl/transport.crt | 0 .../resources/ssl/transport.key | 0 .../AbstractPrivilegeTestCase.java | 0 .../integration/BulkUpdateTests.java | 0 .../integration/ClearRealmsCacheTests.java | 0 .../integration/ClearRolesCacheTests.java | 0 .../ClusterPrivilegeIntegrationTests.java | 0 .../CreateDocsIndexPrivilegeTests.java | 0 .../DateMathExpressionIntegTests.java | 0 .../DocumentAndFieldLevelSecurityTests.java | 0 .../DocumentLevelSecurityRandomTests.java | 0 .../DocumentLevelSecurityTests.java | 0 .../FieldLevelSecurityRandomTests.java | 0 .../integration/FieldLevelSecurityTests.java | 0 .../integration/IndexPrivilegeTests.java | 0 ...onsWithAliasesWildcardsAndRegexsTests.java | 0 .../KibanaSystemRoleIntegTests.java | 0 .../integration/KibanaUserRoleIntegTests.java | 1 + .../MultipleIndicesPermissionsTests.java | 0 .../PermissionPrecedenceTests.java | 0 .../SecurityCachePermissionTests.java | 0 .../integration/SecurityClearScrollTests.java | 0 .../ShrinkIndexWithSecurityTests.java | 0 .../elasticsearch/license/LicensingTests.java | 0 .../test/NativeRealmIntegTestCase.java | 0 .../test/SecuritySingleNodeTestCase.java | 0 .../SecurityServerTransportServiceTests.java | 1 + .../security/ScrollHelperIntegTests.java | 0 .../xpack/security/SecurityPluginTests.java | 0 .../xpack/security/TemplateUpgraderTests.java | 0 .../filter/DestructiveOperationsTests.java | 0 .../AuditTrailSettingsUpdateTests.java | 0 .../security/authc/ApiKeyIntegTests.java | 3 ++ .../xpack/security/authc/RunAsIntegTests.java | 0 .../authc/SecurityRealmSettingsTests.java | 0 .../security/authc/TokenAuthIntegTests.java | 1 + .../esnative/ESNativeMigrateToolTests.java | 0 .../authc/esnative/NativeRealmIntegTests.java | 1 + .../esnative/ReservedRealmIntegTests.java | 0 .../pki/PkiAuthDelegationIntegTests.java | 0 .../authc/pki/PkiAuthenticationTests.java | 0 .../authc/pki/PkiOptionalClientAuthTests.java | 0 .../xpack/security/authz/AnalyzeTests.java | 0 .../security/authz/IndexAliasesTests.java | 0 .../security/authz/ReadActionsTests.java | 0 .../security/authz/SecurityScrollTests.java | 0 .../SecuritySearchOperationListenerTests.java | 0 .../authz/SnapshotUserRoleIntegTests.java | 0 .../security/authz/WriteActionsTests.java | 0 .../store/NativePrivilegeStoreCacheTests.java | 0 .../action/RestAuthenticateActionTests.java | 0 .../SecurityIndexManagerIntegTests.java | 0 ...ServerTransportFilterIntegrationTests.java | 0 .../filter/IpFilteringIntegrationTests.java | 1 + .../filter/IpFilteringUpdateTests.java | 1 + .../netty4/IPHostnameVerificationTests.java | 0 .../netty4/SslHostnameVerificationTests.java | 0 .../transport/ssl/EllipticCurveSSLTests.java | 0 .../transport/ssl/SslIntegrationTests.java | 0 .../transport/ssl/SslMultiPortTests.java | 0 .../user/AnonymousUserIntegTests.java | 0 .../xpack/ssl/SSLClientAuthTests.java | 0 .../ssl/SSLReloadDuringStartupIntegTests.java | 0 .../xpack/ssl/SSLReloadIntegTests.java | 0 .../xpack/ssl/SSLTrustRestrictionsTests.java | 0 x-pack/plugin/spatial/build.gradle | 6 ++- .../mapper/CartesianFieldMapperTests.java | 0 ...GeoShapeWithDocValuesFieldMapperTests.java | 0 .../index/mapper/PointFieldMapperTests.java | 0 .../index/mapper/ShapeFieldMapperTests.java | 0 .../search/ShapeQueryOverPointTests.java | 0 .../search/ShapeQueryOverShapeTests.java | 0 .../xpack/spatial/search/ShapeQueryTests.java | 0 .../spatial/SpatialClientYamlTestSuiteIT.java | 0 .../rest-api-spec/test/10_geo_bounds.yml | 0 .../rest-api-spec/test/20_geo_centroid.yml | 0 .../rest-api-spec/test/30_geotile_grid.yml | 0 .../rest-api-spec/test/40_geohash_grid.yml | 0 x-pack/plugin/stack/qa/rest/build.gradle | 17 ++----- .../xpack/stack/StackYamlIT.java | 0 .../rest-api-spec/test/stack/10_basic.yml | 0 x-pack/plugin/transform/build.gradle | 1 + .../qa/multi-node-tests/build.gradle | 16 +++---- .../transform/integration/TransformIT.java | 0 .../integration/TransformIntegTestCase.java | 0 .../qa/single-node-tests/build.gradle | 13 +++--- .../integration/TransformAuditorIT.java | 0 .../TransformConfigurationIndexIT.java | 0 .../TransformGetAndGetStatsIT.java | 0 .../integration/TransformInternalIndexIT.java | 0 .../integration/TransformMetadataIT.java | 0 .../integration/TransformPivotRestIT.java | 0 .../TransformPivotRestSpecialCasesIT.java | 0 .../integration/TransformProgressIT.java | 0 .../integration/TransformRestTestCase.java | 0 .../integration/TransformRobustnessIT.java | 0 .../TransformTaskFailedStateIT.java | 0 .../integration/TransformUpdateIT.java | 0 .../integration/TransformUsageIT.java | 0 .../continuous/ContinuousTestCase.java | 0 .../continuous/DateHistogramGroupByIT.java | 0 .../continuous/TermsGroupByIT.java | 0 .../continuous/TransformContinuousIT.java | 0 .../TransformSingleNodeTestCase.java | 0 .../TransformCheckpointServiceNodeTests.java | 0 .../TransformConfigManagerTests.java | 0 x-pack/plugin/vectors/build.gradle | 1 + .../mapper/DenseVectorFieldMapperTests.java | 0 .../mapper/SparseVectorFieldMapperTests.java | 0 x-pack/plugin/voting-only-node/build.gradle | 1 + .../VotingOnlyNodePluginTests.java | 0 x-pack/plugin/watcher/build.gradle | 3 +- x-pack/plugin/watcher/qa/common/build.gradle | 7 +++ .../xpack/watcher/WatcherRestTestCase.java | 25 ++++++----- .../watcher/WatcherYamlSuiteTestCase.java | 42 ++++++++++-------- x-pack/plugin/watcher/qa/rest/build.gradle | 25 +++-------- .../SmokeTestWatcherTestSuiteIT.java | 0 .../smoketest/WatcherYamlRestIT.java | 0 .../test/mustache/10_webhook.yml | 0 .../test/mustache/20_array_access.yml | 0 .../test/mustache/25_array_compare.yml | 0 .../test/mustache/30_search_input.yml | 0 .../test/mustache/40_search_transform.yml | 0 .../test/mustache/50_webhook_url_escaping.yml | 0 .../rest-api-spec/test/painless/10_basic.yml | 0 .../test/painless/20_minimal_body.yml | 0 .../test/painless/30_inline_watch.yml | 0 .../test/painless/40_exception.yml | 0 .../test/painless/50_update_scripts.yml | 0 .../60_chain_input_with_transform.yml | 0 .../test/watcher/ack_watch/10_basic.yml | 0 .../ack_watch/20_ack_individual_action.yml | 0 .../30_reset_ack_after_unmet_condition.yml | 0 ...reset_ack_after_unmet_action_condition.yml | 0 .../test/watcher/activate_watch/10_basic.yml | 0 .../test/watcher/delete_watch/10_basic.yml | 0 .../test/watcher/execute_watch/10_basic.yml | 0 .../watcher/execute_watch/20_transform.yml | 0 .../watcher/execute_watch/30_throttled.yml | 0 .../execute_watch/40_ignore_condition.yml | 0 .../watcher/execute_watch/50_action_mode.yml | 0 .../watcher/execute_watch/60_http_input.yml | 0 .../test/watcher/execute_watch/70_invalid.yml | 0 .../test/watcher/execute_watch/80_foreach.yml | 0 .../test/watcher/get_watch/10_basic.yml | 0 .../test/watcher/get_watch/20_missing.yml | 0 .../watcher/get_watch/30_with_chain_input.yml | 0 .../test/watcher/put_watch/10_basic.yml | 0 .../20_put_watch_with_throttle_period.yml | 0 ..._put_watch_with_action_throttle_period.yml | 0 .../put_watch/40_put_watch_as_inactive.yml | 0 .../50_email_attachment_validation.yml | 0 .../60_put_watch_with_action_condition.yml | 0 ...0_put_watch_with_index_action_using_id.yml | 0 .../80_put_get_watch_with_passwords.yml | 0 ...watch_gets_overwritten_without_version.yml | 0 .../put_watch/91_search_total_hits_as_int.yml | 0 .../test/watcher/start_watcher/10_basic.yml | 0 .../test/watcher/stats/10_basic.yml | 0 .../test/watcher/stop_watcher/10_basic.yml | 0 .../test/watcher/usage/10_basic.yml | 0 .../watcher/qa/with-monitoring/build.gradle | 8 ++-- .../MonitoringWithWatcherRestIT.java | 0 .../watcher/qa/with-security/build.gradle | 14 +++--- .../SmokeTestWatcherWithSecurityIT.java | 0 ...cherWithSecurityClientYamlTestSuiteIT.java | 2 +- .../security/10_insufficient_privs.yml | 0 .../watcher/security/20_settings_filter.yml | 0 .../security/20_test_run_as_execute_watch.yml | 0 .../watcher/WatcherConcreteIndexTests.java | 0 .../watcher/WatcherXpackUsageStatsTests.java | 0 .../actions/ActionErrorIntegrationTests.java | 0 .../actions/TimeThrottleIntegrationTests.java | 0 .../actions/email/EmailAttachmentTests.java | 0 .../throttler/ActionThrottleTests.java | 0 .../webhook/WebhookHttpsIntegrationTests.java | 0 .../webhook/WebhookIntegrationTests.java | 0 .../ArrayCompareConditionSearchTests.java | 0 .../CompareConditionSearchTests.java | 0 .../ExecuteWatchQueuedStatsTests.java | 0 .../history/HistoryActionConditionTests.java | 0 .../HistoryTemplateEmailMappingsTests.java | 0 .../HistoryTemplateHttpMappingsTests.java | 0 ...storyTemplateIndexActionMappingsTests.java | 0 ...storyTemplateSearchInputMappingsTests.java | 0 .../HistoryTemplateTimeMappingsTests.java | 0 ...HistoryTemplateTransformMappingsTests.java | 0 .../input/chain/ChainIntegrationTests.java | 0 .../email/EmailSecretsIntegrationTests.java | 0 .../AbstractWatcherIntegrationTestCase.java | 4 +- .../test/integration/BasicWatcherTests.java | 0 .../test/integration/BootStrapTests.java | 0 .../ExecutionVarsIntegrationTests.java | 1 + .../integration/HistoryIntegrationTests.java | 2 + .../HttpSecretsIntegrationTests.java | 0 .../integration/RejectedExecutionTests.java | 0 .../test/integration/SingleNodeTests.java | 0 .../test/integration/WatchAckTests.java | 0 .../test/integration/WatchMetadataTests.java | 0 .../transform/TransformIntegrationTests.java | 0 .../action/activate/ActivateWatchTests.java | 0 .../action/delete/DeleteWatchTests.java | 0 .../action/execute/ExecuteWatchTests.java | 0 .../transport/action/get/GetWatchTests.java | 0 .../watch/WatchStatusIntegrationTests.java | 0 .../actions/email/EmailActionTests.java | 24 ++++++++-- .../actions/webhook/WebhookActionTests.java | 4 +- .../condition/ScriptConditionTests.java | 3 +- 249 files changed, 188 insertions(+), 173 deletions(-) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/blobstore/cache/SearchableSnapshotsBlobStoreCacheIntegTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/LocalStateSearchableSnapshots.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotRecoveryStateIntegrationTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCacheClearingIntegTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java (99%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsPrewarmingIntegTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java (100%) rename x-pack/plugin/searchable-snapshots/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsUuidValidationIntegTests.java (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/roles.yml (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/ssl/README.asciidoc (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/ssl/ca.crt (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/ssl/ca.key (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/ssl/transport.crt (100%) rename x-pack/plugin/security/qa/basic-enable-security/src/{test => javaRestTest}/resources/ssl/transport.key (100%) rename x-pack/plugin/security/qa/security-basic/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/SecurityInBasicRestTestCase.java (100%) rename x-pack/plugin/security/qa/security-basic/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/SecurityWithBasicLicenseIT.java (100%) rename x-pack/plugin/security/qa/security-basic/src/{test => javaRestTest}/resources/roles.yml (100%) rename x-pack/plugin/security/qa/security-disabled/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityDisabledIT.java (100%) rename x-pack/plugin/security/qa/security-not-enabled/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/SetSecurityUserProcessorWithSecurityNotEnabledIT.java (100%) rename x-pack/plugin/security/qa/security-trial/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java (100%) rename x-pack/plugin/security/qa/security-trial/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java (100%) rename x-pack/plugin/security/qa/security-trial/src/{test => javaRestTest}/resources/roles.yml (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/java/org/elasticsearch/xpack/security/TlsWithBasicLicenseIT.java (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/README.asciidoc (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/ca.crt (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/ca.key (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/ca.p12 (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/http.crt (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/http.key (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/transport.crt (100%) rename x-pack/plugin/security/qa/tls-basic/src/{test => javaRestTest}/resources/ssl/transport.key (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/AbstractPrivilegeTestCase.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/BulkUpdateTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/ClearRealmsCacheTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/ClearRolesCacheTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/CreateDocsIndexPrivilegeTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/DocumentAndFieldLevelSecurityTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/DocumentLevelSecurityRandomTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/FieldLevelSecurityRandomTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/FieldLevelSecurityTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/IndexPrivilegeTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/KibanaSystemRoleIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/KibanaUserRoleIntegTests.java (99%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/PermissionPrecedenceTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/SecurityCachePermissionTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/SecurityClearScrollTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/license/LicensingTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/test/NativeRealmIntegTestCase.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java (97%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/ScrollHelperIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/SecurityPluginTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/TemplateUpgraderTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/action/filter/DestructiveOperationsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java (99%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/RunAsIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/SecurityRealmSettingsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/TokenAuthIntegTests.java (99%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java (99%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthenticationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/AnalyzeTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/IndexAliasesTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/ReadActionsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/SecurityScrollTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/SecuritySearchOperationListenerTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/SnapshotUserRoleIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreCacheTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java (98%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringUpdateTests.java (99%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/netty4/IPHostnameVerificationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/netty4/SslHostnameVerificationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/ssl/EllipticCurveSSLTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/ssl/SslIntegrationTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/transport/ssl/SslMultiPortTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/security/user/AnonymousUserIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/ssl/SSLReloadDuringStartupIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java (100%) rename x-pack/plugin/security/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/ssl/SSLTrustRestrictionsTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java (100%) rename x-pack/plugin/spatial/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTests.java (100%) rename x-pack/plugin/spatial/src/{test => yamlRestTest}/java/org/elasticsearch/xpack/spatial/SpatialClientYamlTestSuiteIT.java (100%) rename x-pack/plugin/spatial/src/{test => yamlRestTest}/resources/rest-api-spec/test/10_geo_bounds.yml (100%) rename x-pack/plugin/spatial/src/{test => yamlRestTest}/resources/rest-api-spec/test/20_geo_centroid.yml (100%) rename x-pack/plugin/spatial/src/{test => yamlRestTest}/resources/rest-api-spec/test/30_geotile_grid.yml (100%) rename x-pack/plugin/spatial/src/{test => yamlRestTest}/resources/rest-api-spec/test/40_geohash_grid.yml (100%) rename x-pack/plugin/stack/qa/rest/src/{test => yamlRestTest}/java/org/elasticsearch/xpack/stack/StackYamlIT.java (100%) rename x-pack/plugin/stack/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/stack/10_basic.yml (100%) rename x-pack/plugin/transform/qa/multi-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformIT.java (100%) rename x-pack/plugin/transform/qa/multi-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformAuditorIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformMetadataIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformUpdateIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/continuous/DateHistogramGroupByIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/continuous/TermsGroupByIT.java (100%) rename x-pack/plugin/transform/qa/single-node-tests/src/{test => javaRestTest}/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java (100%) rename x-pack/plugin/transform/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/transform/TransformSingleNodeTestCase.java (100%) rename x-pack/plugin/transform/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/transform/checkpoint/TransformCheckpointServiceNodeTests.java (100%) rename x-pack/plugin/transform/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java (100%) rename x-pack/plugin/vectors/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java (100%) rename x-pack/plugin/vectors/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java (100%) rename x-pack/plugin/voting-only-node/src/{test => internalClusterTest}/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePluginTests.java (100%) create mode 100644 x-pack/plugin/watcher/qa/common/build.gradle rename x-pack/plugin/watcher/qa/{rest/src/test => common/src/main}/java/org/elasticsearch/xpack/watcher/WatcherRestTestCase.java (75%) rename x-pack/plugin/watcher/qa/{rest/src/test => common/src/main}/java/org/elasticsearch/xpack/watcher/WatcherYamlSuiteTestCase.java (74%) rename x-pack/plugin/watcher/qa/rest/src/{test => javaRestTest}/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/java/org/elasticsearch/smoketest/WatcherYamlRestIT.java (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/10_webhook.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/20_array_access.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/25_array_compare.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/30_search_input.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/40_search_transform.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/mustache/50_webhook_url_escaping.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/20_minimal_body.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/30_inline_watch.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/40_exception.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/50_update_scripts.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/painless/60_chain_input_with_transform.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/ack_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/ack_watch/20_ack_individual_action.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/ack_watch/30_reset_ack_after_unmet_condition.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/ack_watch/40_reset_ack_after_unmet_action_condition.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/activate_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/delete_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/20_transform.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/30_throttled.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/40_ignore_condition.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/50_action_mode.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/60_http_input.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/70_invalid.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/execute_watch/80_foreach.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/get_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/get_watch/20_missing.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/get_watch/30_with_chain_input.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/20_put_watch_with_throttle_period.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/30_put_watch_with_action_throttle_period.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/40_put_watch_as_inactive.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/50_email_attachment_validation.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/60_put_watch_with_action_condition.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/70_put_watch_with_index_action_using_id.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/80_put_get_watch_with_passwords.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/90_ensure_watch_gets_overwritten_without_version.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/put_watch/91_search_total_hits_as_int.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/start_watcher/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/stats/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/stop_watcher/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/rest/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/usage/10_basic.yml (100%) rename x-pack/plugin/watcher/qa/with-monitoring/src/{test => javaRestTest}/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java (100%) rename x-pack/plugin/watcher/qa/with-security/src/{test => javaRestTest}/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java (100%) rename x-pack/plugin/watcher/qa/with-security/src/{test => yamlRestTest}/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityClientYamlTestSuiteIT.java (97%) rename x-pack/plugin/watcher/qa/with-security/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/security/10_insufficient_privs.yml (100%) rename x-pack/plugin/watcher/qa/with-security/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/security/20_settings_filter.yml (100%) rename x-pack/plugin/watcher/qa/with-security/src/{test => yamlRestTest}/resources/rest-api-spec/test/watcher/security/20_test_run_as_execute_watch.yml (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/WatcherConcreteIndexTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/WatcherXpackUsageStatsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/ActionErrorIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookHttpsIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/execution/ExecuteWatchQueuedStatsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryActionConditionTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateEmailMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateIndexActionMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateSearchInputMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTimeMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java (99%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java (99%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java (99%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/transport/action/get/GetWatchTests.java (100%) rename x-pack/plugin/watcher/src/{test => internalClusterTest}/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java (100%) diff --git a/x-pack/plugin/searchable-snapshots/build.gradle b/x-pack/plugin/searchable-snapshots/build.gradle index 9a7304f9dc8..049dae0185e 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 c6fadc94983..68e01d979ed 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.SearchableSnapshotsSta 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.anyOf; 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 @@ public class SearchableSnapshotsIntegTests extends BaseSearchableSnapshotsIntegT 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 f4e4056848b..26d6b2c3183 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 292a3e7cf88..0bf30d055e7 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 fa5426eb3e6..cc7aae88109 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 c52dfb27287..ff25b3667c4 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 5488bbf5cca..6b1f8264105 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 1ffb181c441..d95be17c2d6 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 d5fc9c20ee1..7da9798194e 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/IndexPrivilegeTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndexPrivilegeTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndexPrivilegeTests.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 2fcce3e7f60..bb26a95eaf5 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 class KibanaUserRoleIntegTests extends NativeRealmIntegTestCase { 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 233f80db6d5..f9ea04cfa60 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 @@ public class SecurityServerTransportServiceTests extends SecurityIntegTestCase { 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 ec8c662bf04..0d4dbc343bd 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 class ApiKeyIntegTests extends SecurityIntegTestCase { 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 class ApiKeyIntegTests extends SecurityIntegTestCase { 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 class ApiKeyIntegTests extends SecurityIntegTestCase { 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 ea55c822f76..8b18e7b86ef 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 class TokenAuthIntegTests extends SecurityIntegTestCase { .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/ESNativeMigrateToolTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java 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 3bc220d6a68..21f0d1403da 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 class NativeRealmIntegTests extends NativeRealmIntegTestCase { 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/ServerTransportFilterIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.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 d8282a3e759..40b127eceab 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.ESIntegTestCase.Scope; 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 e75b0d1a2b4..fd91455023b 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.cluster.ClusterState; 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/netty4/IPHostnameVerificationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/netty4/IPHostnameVerificationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/IPHostnameVerificationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/netty4/IPHostnameVerificationTests.java diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SslHostnameVerificationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/netty4/SslHostnameVerificationTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SslHostnameVerificationTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/netty4/SslHostnameVerificationTests.java 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/transport/ssl/SslMultiPortTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/SslMultiPortTests.java similarity index 100% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/ssl/SslMultiPortTests.java rename to x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/ssl/SslMultiPortTests.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 9566e920155..0539e6cee42 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 dfa43ed0444..e341cbf957c 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 0c527f6ac3e..988d1cf6e9a 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 33e4dc540c6..a8df3ece056 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 4cb27bc9a0a..5c2dd0686cf 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 b41425ae919..ffaf25c4945 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 a12eaf4c580..1bbe42bc426 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 7355eb37d57..b19c5c73ee9 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 00000000000..fca0d41407f --- /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 8a1126c43c6..42c6a4b6ecb 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 @@ package org.elasticsearch.xpack.watcher; 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 abstract class WatcherRestTestCase extends ESRestTestCase { @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 abstract class WatcherRestTestCase extends ESRestTestCase { 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 abstract class WatcherRestTestCase extends ESRestTestCase { 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 7dd064f7dbc..d41579230d9 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 @@ package org.elasticsearch.xpack.watcher; 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 java.util.concurrent.TimeUnit; 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 abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase @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 abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase }); } - @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 abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase 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 abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase 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 f26d6f376b7..00a7d1925ab 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 4d95fbc1ad1..00c5e38aeac 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 1f467979c2a..bb1334ddc44 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 5bebf4ebc23..aa33800a2ab 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 class SmokeTestWatcherWithSecurityClientYamlTestSuiteIT extends WatcherYa @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/WatcherXpackUsageStatsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/WatcherXpackUsageStatsTests.java similarity index 100% rename from x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherXpackUsageStatsTests.java rename to x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/WatcherXpackUsageStatsTests.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 a8e30b9d3aa..4a2781bcd2b 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.LicenseService; 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 @@ import static org.mockito.Mockito.mock; @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 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase 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 9b92294a070..450467f0ae6 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 class ExecutionVarsIntegrationTests extends AbstractWatcherIntegrationTes } } + @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 afb42c65b6b..4d9b99dc32d 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 class HistoryIntegrationTests extends AbstractWatcherIntegrationTestCase // 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 class HistoryIntegrationTests extends AbstractWatcherIntegrationTestCase // 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 9ed94359689..6a31ef68525 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.Strings; 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.XContentParser; 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.EmailAttach 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.ZoneOffset; 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 class EmailActionTests extends ESTestCase { 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 class EmailActionTests extends ESTestCase { } 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 class EmailActionTests extends ESTestCase { } 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 @@ public class EmailActionTests extends ESTestCase { 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 439eb45f015..22d6573ffb6 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.actions.Action.Result.Status; 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.common.text.TextTemplateEngine; 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 @@ public class WebhookActionTests extends ESTestCase { 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 70ca6bf1683..af71b0d7842 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.test.ESTestCase; 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 class ScriptConditionTests extends ESTestCase { 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 -> {