apply from: "$rootDir/gradle/instrumentation.gradle"
apply plugin: 'org.unbroken-dome.test-sets'

muzzle {
  pass {
    group = "org.elasticsearch.client"
    module = "rest"
    versions = "[5.0,6.4)"
    assertInverse = true
  }

  pass {
    group = "org.elasticsearch.client"
    module = "elasticsearch-rest-client"
    versions = "[5.0,6.4)"
  }
}

testSets {
  latestDepTest
}

dependencies {
  compileOnly group: 'org.elasticsearch.client', name: 'rest', version: '5.0.0'

  implementation project(':instrumentation:elasticsearch:elasticsearch-rest-common:javaagent')

  testInstrumentation project(':instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent')
  testInstrumentation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')

  testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
  testImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'

  testImplementation group: 'org.elasticsearch.client', name: 'rest', version: '5.0.0'
  testImplementation group: 'org.elasticsearch', name: 'elasticsearch', version: '5.0.0'
  testImplementation group: 'org.elasticsearch.plugin', name: 'transport-netty3-client', version: '5.0.0'

  latestDepTestImplementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '6.3.+'
  latestDepTestImplementation group: 'org.elasticsearch', name: 'elasticsearch', version: '6.3.+'
  latestDepTestImplementation group: 'org.elasticsearch.plugin', name: 'transport-netty4-client', version: '6.3.+'
}

configurations.latestDepTestImplementation {
  exclude group: "org.elasticsearch.client", module: "rest"
}
