apply plugin: 'elasticsearch.standalone-test'

configurations.all {
  exclude group: 'org.slf4j', module: 'slf4j-nop'
}
dependencies {
  testImplementation project(':test:framework')
  testImplementation project(xpackModule('core'))
  testImplementation project(xpackModule('security'))
  testImplementation(testArtifact(project(xpackModule('security'))))
  testImplementation project(":x-pack:test:smb-fixture")
}

// add test resources from security, so tests can use example certs
tasks.named("processTestResources").configure {
  duplicatesStrategy = DuplicatesStrategy.INCLUDE
  from(project(xpackModule('core')).sourceSets.test.resources.srcDirs)
  from(project(xpackModule('security')).sourceSets.test.resources.srcDirs)
}

// we have to repeat these patterns because the security test resources are effectively in the src of this p
tasks.named("forbiddenPatterns").configure {
  exclude '**/*.key'
  exclude '**/*.p12'
  exclude '**/*.der'
}

tasks.named("test").configure {
  systemProperty 'tests.security.manager', 'false'
  include '**/*IT.class'
  include '**/*Tests.class'
}
