/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'java-library'

description = 'Solr Test Framework'

dependencies {
  // Spotbugs Annotations are only needed for old findbugs
  // annotation usage like in Zookeeper during compilation time.
  // It is not included in the release so exclude from checks.
  compileOnly libs.spotbugs.annotations
  permitUnusedDeclared libs.spotbugs.annotations
  // Exclude these from jar validation and license checks.
  configurations.jarValidation {
    exclude group: "com.github.spotbugs", module: "spotbugs-annotations"
  }

  api project(':solr:core')
  api project(':solr:solrj')
  api project(':solr:api')
  implementation project(':solr:solrj-zookeeper')

  api libs.apache.lucene.testframework
  implementation libs.apache.lucene.core
  implementation libs.apache.lucene.queries
  implementation libs.apache.lucene.suggest


  var zkExcludes = {
    exclude group: "org.apache.yetus", module: "audience-annotations"
  }
  implementation(libs.apache.curator.client) {
    exclude group: 'org.apache.zookeeper', module: 'zookeeper'
  }
  implementation(libs.apache.curator.framework) {
    exclude group: 'org.apache.zookeeper', module: 'zookeeper'
  }
  // Necessary because ChaosMonkey uses KillSession from curator-test
  implementation(libs.apache.curator.test) {
    exclude group: 'org.apache.zookeeper', module: 'zookeeper'
    exclude group: 'com.google.guava', module: 'guava'
    exclude group: 'io.dropwizard.metrics', module: 'metrics-core'
  }

  implementation(libs.apache.zookeeper.zookeeper, zkExcludes)
  implementation(libs.apache.zookeeper.jute, zkExcludes)
  implementation(variantOf(libs.apache.zookeeper.zookeeper) { classifier 'tests' }, zkExcludes)

  implementation libs.commonsio.commonsio
  implementation libs.slf4j.api
  implementation libs.apache.log4j.api
  implementation libs.apache.log4j.core
  implementation libs.dropwizard.metrics.core
  implementation libs.dropwizard.metrics.jetty12.ee10
  implementation libs.commonscli.commonscli
  permitUnusedDeclared libs.commonscli.commonscli
  implementation libs.apache.httpcomponents.httpclient
  implementation libs.apache.httpcomponents.httpcore
  implementation libs.opentelemetry.api

  implementation libs.jakarta.servlet.api
  implementation libs.eclipse.jetty.server
  implementation libs.eclipse.jetty.session
  api libs.eclipse.jetty.ee10.servlet
  implementation libs.eclipse.jetty.util
  implementation libs.eclipse.jetty.alpnserver
  runtimeOnly(libs.eclipse.jetty.alpnjavaserver, {
    exclude group: "org.eclipse.jetty.alpn", module: "alpn-api"
  })
  implementation libs.eclipse.jetty.rewrite
  implementation libs.eclipse.jetty.http2.server
  implementation libs.eclipse.jetty.http2.common

  implementation libs.carrotsearch.randomizedtesting.runner
  implementation libs.junit.junit
  implementation libs.hamcrest.hamcrest
}
