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

dependencies {
  yamlRestTestImplementation(testArtifact(project(xpackModule('core'))))
}

restResources {
  restApi {
    include '_common', 'cluster', 'indices', 'index', 'snapshot', 'ilm', 'slm', 'health_report'
  }
}

testClusters.configureEach {
  testDistribution = 'DEFAULT'
  setting 'xpack.ml.enabled', 'false'
  setting 'xpack.license.self_generated.type', 'trial'
  setting 'xpack.security.autoconfiguration.enabled', 'false'
}

configurations {
  basicRestSpecs {
    attributes {
      attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
    }
  }
}

artifacts {
  basicRestSpecs(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
}
