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

muzzle {
  pass {
    group = "javax.jms"
    module = "jms-api"
    versions = "(,)"
  }
  pass {
    group = "javax.jms"
    module = "javax.jms-api"
    versions = "(,)"
  }
}

testSets {
  jms2Test {
    filter {
      // this is needed because "test.dependsOn jms2Test", and so without this,
      // running a single test in the default test set will fail
      setFailOnNoMatchingTests(false)
    }
  }
}

// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/919
jms2Test.forkEvery 1
test.dependsOn jms2Test

dependencies {
  compileOnly group: 'javax.jms', name: 'jms-api', version: '1.1-rev-1'

  testImplementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
  testImplementation("org.springframework.boot:spring-boot-starter-activemq:${versions.springboot}")
  testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springboot) {
    exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
  }

  jms2TestImplementation group: 'org.hornetq', name: 'hornetq-jms-client', version: '2.4.7.Final'
  jms2TestImplementation group: 'org.hornetq', name: 'hornetq-jms-server', version: '2.4.7.Final'
}
