/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

apply plugin: 'elasticsearch.legacy-java-rest-test'
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'

import org.elasticsearch.gradle.Version

restResources {
  restApi {
    include '_common', 'bulk', 'indices', 'index', 'ingest.delete_pipeline', 'ingest.put_pipeline', 'enrich', 'get', 'capabilities'
  }
  restTests {
    includeXpack 'enrich'
  }
}

dependencies {
  javaRestTestImplementation project(path: xpackModule('enrich:qa:common'))
}

if (buildParams.inFipsJvm){
  // This test cluster is using a BASIC license and FIPS 140 mode is not supported in BASIC
  tasks.named("javaRestTest").configure{enabled = false }
  tasks.named("yamlRestTest").configure{enabled = false }
}

testClusters.configureEach {
  testDistribution = 'DEFAULT'
  setting 'xpack.license.self_generated.type', 'basic'
  setting 'xpack.monitoring.collection.enabled', 'true'
  setting 'xpack.security.enabled', 'false'
  requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.4.0")
}

