apply plugin: 'elasticsearch.standalone-test'

dependencies {
  testImplementation project(xpackModule('core'))
  testImplementation project(xpackModule('security'))
  testImplementation(testArtifact(project(xpackModule('core'))))
  testImplementation(testArtifact(project(xpackModule('security'))))
  testImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
  testRuntimeOnly "com.google.guava:guava:${versions.jimfs_guava}"
}

configurations.all {
  resolutionStrategy {
    forcedModules = ["com.google.guava:guava:${versions.jimfs_guava}"]
  }
}
// add test resources from security, so certificate tool tests can use example certs
tasks.named("processTestResources").configure {
  from(project(xpackModule('security')).sourceSets.test.resources.srcDirs)
}

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