/*
 * Copyright © 2019 Apple Inc. and the ServiceTalk project authors
 *
 * Licensed 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: "io.servicetalk.servicetalk-gradle-plugin-internal-library"

def actualJerseyVersion = "${jerseyVersion}"
def actualJavaxAnnotationsApiVersion = "${javaxAnnotationsApiVersion}"
def actualJaxRsVersion = "${jaxRsVersion}"

// Dependencies must remain consistent between servicetalk-http-security-jerseyX modules
dependencies {
  api project(":servicetalk-context-api")
  api "jakarta.ws.rs:jakarta.ws.rs-api:$actualJaxRsVersion"

  implementation platform("org.glassfish.jersey:jersey-bom:$actualJerseyVersion")
  implementation project(":servicetalk-annotations")
  implementation project(":servicetalk-concurrent-api")

  compileOnly "jakarta.annotation:jakarta.annotation-api:$actualJavaxAnnotationsApiVersion"

  runtimeOnly "org.glassfish.jersey.core:jersey-common"

  testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version")
  testImplementation testFixtures(project(":servicetalk-transport-netty-internal"))
  testImplementation project(":servicetalk-buffer-api")
  testImplementation project(":servicetalk-http-api")
  testImplementation project(":servicetalk-http-netty")
  testImplementation project(":servicetalk-http-router-jersey")
  testImplementation project(":servicetalk-http-utils")
  testImplementation project(":servicetalk-transport-api")
  testImplementation "org.junit.jupiter:junit-jupiter-api"
  testImplementation "org.junit.jupiter:junit-jupiter-params"
  testImplementation "net.javacrumbs.json-unit:json-unit-fluent:$jsonUnitVersion"
  testImplementation "org.glassfish.jersey.core:jersey-server"
  testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
  testImplementation "org.mockito:mockito-core:$mockitoCoreVersion"
  testImplementation "org.mockito:mockito-junit-jupiter:$mockitoCoreVersion"

  testRuntimeOnly testFixtures(project(":servicetalk-concurrent-internal"))
  // BaseJerseyRouterTestSuite assumes JSON serialization is supported.
  testRuntimeOnly project(":servicetalk-data-jackson-jersey")
  testRuntimeOnly project(":servicetalk-test-resources")
  testRuntimeOnly "org.glassfish.jersey.inject:jersey-hk2"
}
