From cda273e02b3e4768a4b9cb77292f100b3f5adacf Mon Sep 17 00:00:00 2001 From: Mike Duigou Date: Tue, 24 May 2022 10:48:57 -0700 Subject: [PATCH] Use `servicetalk-dependencies` for tests (#2219) Motivation: Some of the dependencies imported for tests can use the `servicetalk-dependencies` BOM introduced in #2210. Modifications: Import `servicetalk-dependencies` for test configurations Result: Better management of test dependencies. --- servicetalk-concurrent-api/build.gradle | 10 ++++++---- servicetalk-concurrent-internal/build.gradle | 5 +++-- servicetalk-concurrent-reactivestreams/build.gradle | 2 +- servicetalk-http-api/build.gradle | 3 ++- servicetalk-http-netty/build.gradle | 3 ++- servicetalk-http-router-jersey/build.gradle | 2 +- servicetalk-log4j2-mdc-utils/build.gradle | 9 +++++---- servicetalk-opentracing-asynccontext/build.gradle | 5 +++-- servicetalk-opentracing-http/build.gradle | 6 ++++-- servicetalk-opentracing-log4j2/build.gradle | 7 ++++--- servicetalk-serializer-utils/build.gradle | 4 ++-- servicetalk-tcp-netty-internal/build.gradle | 8 ++++---- servicetalk-transport-netty-internal/build.gradle | 3 ++- 13 files changed, 39 insertions(+), 28 deletions(-) diff --git a/servicetalk-concurrent-api/build.gradle b/servicetalk-concurrent-api/build.gradle index 9a50545254..73ea04c318 100644 --- a/servicetalk-concurrent-api/build.gradle +++ b/servicetalk-concurrent-api/build.gradle @@ -18,7 +18,9 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { api platform(project(":servicetalk-dependencies")) + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-concurrent") @@ -35,15 +37,15 @@ dependencies { testImplementation project(":servicetalk-test-resources") testImplementation "org.junit.jupiter:junit-jupiter-api" testImplementation "org.junit.jupiter:junit-jupiter-params" - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" + testImplementation "org.hamcrest:hamcrest" testImplementation "org.mockito:mockito-core:$mockitoCoreVersion" testFixturesImplementation testFixtures(project(":servicetalk-concurrent-internal")) testFixturesImplementation project(":servicetalk-utils-internal") testFixturesImplementation project(":servicetalk-concurrent-test-internal") - testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version" + testFixturesImplementation "com.google.code.findbugs:jsr305" testFixturesImplementation "org.junit.jupiter:junit-jupiter-api" - testFixturesImplementation "org.hamcrest:hamcrest:$hamcrestVersion" + testFixturesImplementation "org.hamcrest:hamcrest" testFixturesImplementation "org.mockito:mockito-core:$mockitoCoreVersion" - testFixturesImplementation "org.slf4j:slf4j-api:$slf4jVersion" + testFixturesImplementation "org.slf4j:slf4j-api" } diff --git a/servicetalk-concurrent-internal/build.gradle b/servicetalk-concurrent-internal/build.gradle index 2dc39ba8d4..e558b9c576 100644 --- a/servicetalk-concurrent-internal/build.gradle +++ b/servicetalk-concurrent-internal/build.gradle @@ -19,6 +19,7 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-concurrent") @@ -36,6 +37,6 @@ dependencies { testFixturesImplementation project(":servicetalk-annotations") testFixturesImplementation "org.junit.jupiter:junit-jupiter-api" - testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version" - testFixturesImplementation "org.slf4j:slf4j-api:$slf4jVersion" + testFixturesImplementation "com.google.code.findbugs:jsr305" + testFixturesImplementation "org.slf4j:slf4j-api" } diff --git a/servicetalk-concurrent-reactivestreams/build.gradle b/servicetalk-concurrent-reactivestreams/build.gradle index 09a2ba698a..4b01051596 100644 --- a/servicetalk-concurrent-reactivestreams/build.gradle +++ b/servicetalk-concurrent-reactivestreams/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-concurrent-api") - api "org.reactivestreams:reactive-streams:$reactiveStreamsVersion" + api "org.reactivestreams:reactive-streams" implementation project(":servicetalk-annotations") implementation project(":servicetalk-serializer-utils") diff --git a/servicetalk-http-api/build.gradle b/servicetalk-http-api/build.gradle index 6614ee67c2..463ce8bd5b 100644 --- a/servicetalk-http-api/build.gradle +++ b/servicetalk-http-api/build.gradle @@ -19,6 +19,7 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-buffer-api") @@ -59,7 +60,7 @@ dependencies { testFixturesImplementation testFixtures(project(":servicetalk-concurrent-internal")) testFixturesImplementation testFixtures(project(":servicetalk-transport-netty-internal")) testFixturesImplementation project(":servicetalk-buffer-netty") - testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version" + testFixturesImplementation "com.google.code.findbugs:jsr305" testFixturesImplementation "org.junit.jupiter:junit-jupiter-api" testFixturesImplementation "org.junit.jupiter:junit-jupiter-params" testFixturesImplementation "org.hamcrest:hamcrest:$hamcrestVersion" diff --git a/servicetalk-http-netty/build.gradle b/servicetalk-http-netty/build.gradle index 4021f2b881..df0ca3b80a 100644 --- a/servicetalk-http-netty/build.gradle +++ b/servicetalk-http-netty/build.gradle @@ -18,8 +18,9 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) - implementation platform("io.netty:netty-bom:$nettyVersion") + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) api project(":servicetalk-concurrent-api") api project(":servicetalk-logging-api") diff --git a/servicetalk-http-router-jersey/build.gradle b/servicetalk-http-router-jersey/build.gradle index 0012a162d7..7b4f7cdff3 100644 --- a/servicetalk-http-router-jersey/build.gradle +++ b/servicetalk-http-router-jersey/build.gradle @@ -18,8 +18,8 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { api platform(project(":servicetalk-dependencies")) - testFixturesImplementation platform("org.glassfish.jersey:jersey-bom:$jerseyVersion") testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-http-api") diff --git a/servicetalk-log4j2-mdc-utils/build.gradle b/servicetalk-log4j2-mdc-utils/build.gradle index b081399464..8a9e22b48a 100644 --- a/servicetalk-log4j2-mdc-utils/build.gradle +++ b/servicetalk-log4j2-mdc-utils/build.gradle @@ -18,8 +18,9 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { api platform(project(":servicetalk-dependencies")) + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") - testFixturesImplementation enforcedPlatform(project(":servicetalk-dependencies")) + testFixturesImplementation platform(project(":servicetalk-dependencies")) api "org.apache.logging.log4j:log4j-api" @@ -31,13 +32,13 @@ dependencies { testImplementation project(":servicetalk-test-resources") testImplementation "org.junit.jupiter:junit-jupiter-api" - testImplementation "org.slf4j:slf4j-api:$slf4jVersion" - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" + testImplementation "org.slf4j:slf4j-api" + testImplementation "org.hamcrest:hamcrest" testFixturesImplementation "com.google.code.findbugs:jsr305" testFixturesImplementation "org.apache.logging.log4j:log4j-core" testFixturesImplementation "org.hamcrest:hamcrest" - testFixturesImplementation "org.slf4j:slf4j-api:$slf4jVersion" + testFixturesImplementation "org.slf4j:slf4j-api" testFixturesRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl" } diff --git a/servicetalk-opentracing-asynccontext/build.gradle b/servicetalk-opentracing-asynccontext/build.gradle index 3357b860fc..69164a62e3 100644 --- a/servicetalk-opentracing-asynccontext/build.gradle +++ b/servicetalk-opentracing-asynccontext/build.gradle @@ -18,6 +18,7 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-opentracing-inmemory") @@ -28,8 +29,8 @@ dependencies { testImplementation project(":servicetalk-test-resources") testImplementation "org.junit.jupiter:junit-jupiter-api" - testImplementation "org.slf4j:slf4j-api:$slf4jVersion" - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" + testImplementation "org.slf4j:slf4j-api" + testImplementation "org.hamcrest:hamcrest" testImplementation "org.mockito:mockito-core:$mockitoCoreVersion" testImplementation "org.mockito:mockito-junit-jupiter:$mockitoCoreVersion" } diff --git a/servicetalk-opentracing-http/build.gradle b/servicetalk-opentracing-http/build.gradle index 31372283c5..58485c2bda 100644 --- a/servicetalk-opentracing-http/build.gradle +++ b/servicetalk-opentracing-http/build.gradle @@ -18,7 +18,9 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { api platform(project(":servicetalk-dependencies")) + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testRuntimeOnly enforcedPlatform(project(":servicetalk-dependencies")) api project(":servicetalk-http-api") api "io.opentracing:opentracing-api" @@ -42,10 +44,10 @@ dependencies { testImplementation project(":servicetalk-opentracing-asynccontext") testImplementation project(":servicetalk-test-resources") testImplementation project(":servicetalk-opentracing-log4j2") - testImplementation "org.apache.logging.log4j:log4j-core:$log4jVersion" + testImplementation "org.apache.logging.log4j:log4j-core" testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" testImplementation "org.junit.jupiter:junit-jupiter-api" testImplementation "org.mockito:mockito-core:$mockitoCoreVersion" testImplementation "org.mockito:mockito-junit-jupiter:$mockitoCoreVersion" - testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" + testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl" } diff --git a/servicetalk-opentracing-log4j2/build.gradle b/servicetalk-opentracing-log4j2/build.gradle index 7ceb58188e..cef8c640ff 100644 --- a/servicetalk-opentracing-log4j2/build.gradle +++ b/servicetalk-opentracing-log4j2/build.gradle @@ -18,6 +18,7 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-log4j2-mdc-utils") @@ -33,7 +34,7 @@ dependencies { testImplementation testFixtures(project(":servicetalk-log4j2-mdc-utils")) testImplementation "org.junit.jupiter:junit-jupiter-api" - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" - testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion" - testImplementation "org.apache.logging.log4j:log4j-core:$log4jVersion" + testImplementation "org.hamcrest:hamcrest" + testImplementation "org.apache.logging.log4j:log4j-core" + testImplementation "org.apache.logging.log4j:log4j-slf4j-impl" } diff --git a/servicetalk-serializer-utils/build.gradle b/servicetalk-serializer-utils/build.gradle index 24172e2550..eb6822f79d 100644 --- a/servicetalk-serializer-utils/build.gradle +++ b/servicetalk-serializer-utils/build.gradle @@ -32,9 +32,9 @@ dependencies { testImplementation testFixtures(project(":servicetalk-concurrent-internal")) testImplementation project(":servicetalk-concurrent-test-internal") testImplementation project(":servicetalk-buffer-netty") - testImplementation "com.google.protobuf:protobuf-java:$protobufVersion" + testImplementation "com.google.protobuf:protobuf-java" testImplementation "org.junit.jupiter:junit-jupiter-api" testImplementation "org.junit.jupiter:junit-jupiter-params" - testImplementation "org.hamcrest:hamcrest:$hamcrestVersion" + testImplementation "org.hamcrest:hamcrest" testImplementation "org.mockito:mockito-core:$mockitoCoreVersion" } diff --git a/servicetalk-tcp-netty-internal/build.gradle b/servicetalk-tcp-netty-internal/build.gradle index 45b107e7fe..04203d6276 100644 --- a/servicetalk-tcp-netty-internal/build.gradle +++ b/servicetalk-tcp-netty-internal/build.gradle @@ -19,9 +19,9 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { implementation platform(project(":servicetalk-dependencies")) - testImplementation enforcedPlatform("io.netty:netty-bom:$nettyVersion") + testImplementation enforcedPlatform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") - testFixturesImplementation platform("io.netty:netty-bom:$nettyVersion") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-client-api") @@ -48,7 +48,7 @@ dependencies { testFixturesImplementation testFixtures(project(":servicetalk-concurrent-api")) testFixturesImplementation testFixtures(project(":servicetalk-transport-netty-internal")) - testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version" + testFixturesImplementation "com.google.code.findbugs:jsr305" testFixturesImplementation "io.netty:netty-transport-native-epoll" testFixturesRuntimeOnly( group:"io.netty", name:"netty-transport-native-epoll", classifier:"linux-x86_64") testFixturesRuntimeOnly( group:"io.netty", name:"netty-transport-native-epoll", classifier:"linux-aarch_64") @@ -58,5 +58,5 @@ dependencies { testFixturesImplementation "org.junit.jupiter:junit-jupiter-api" testFixturesImplementation "org.hamcrest:hamcrest:$hamcrestVersion" testFixturesImplementation "org.mockito:mockito-core:$mockitoCoreVersion" - testFixturesImplementation "org.slf4j:slf4j-api:$slf4jVersion" + testFixturesImplementation "org.slf4j:slf4j-api" } diff --git a/servicetalk-transport-netty-internal/build.gradle b/servicetalk-transport-netty-internal/build.gradle index b1a109c789..284d2647fe 100644 --- a/servicetalk-transport-netty-internal/build.gradle +++ b/servicetalk-transport-netty-internal/build.gradle @@ -19,6 +19,7 @@ apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-library" dependencies { api platform(project(":servicetalk-dependencies")) testImplementation enforcedPlatform("org.junit:junit-bom:$junit5Version") + testFixturesImplementation platform(project(":servicetalk-dependencies")) testFixturesImplementation platform("org.junit:junit-bom:$junit5Version") api project(":servicetalk-buffer-netty") @@ -61,7 +62,7 @@ dependencies { testFixturesImplementation project(":servicetalk-utils-internal") testFixturesImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion" - testFixturesImplementation "com.google.code.findbugs:jsr305:$jsr305Version" + testFixturesImplementation "com.google.code.findbugs:jsr305" testFixturesImplementation "org.junit.jupiter:junit-jupiter-api" testFixturesImplementation "org.hamcrest:hamcrest:$hamcrestVersion" testFixturesImplementation "org.mockito:mockito-core:$mockitoCoreVersion"