From 0b63157a4bc18df3c565180954dff485762645a8 Mon Sep 17 00:00:00 2001 From: Dominic Fox <40790090+r3domfox@users.noreply.github.com> Date: Wed, 15 May 2019 16:40:12 +0100 Subject: [PATCH] ENT-3422 Add JUnit 5 dependencies to all projects (#5084) * ENT-3422 Add JUnit 5 dependencies to all projects * Remove explicit junit 4 imports where not needed * Minor PR fixes * Limit import scope --- build.gradle | 9 +++++++++ client/jackson/build.gradle | 9 ++++++++- client/jfx/build.gradle | 7 ++++++- client/mock/build.gradle | 7 ++++++- client/rpc/build.gradle | 7 ++++++- common/configuration-parsing/build.gradle | 7 ++++++- confidential-identities/build.gradle | 6 +++++- core-deterministic/testing/data/build.gradle | 7 ++++++- core-deterministic/testing/verifier/build.gradle | 1 + core/build.gradle | 14 ++++++++++++-- djvm/djvm/build.gradle | 3 ++- experimental/avalanche/build.gradle | 7 ++++++- experimental/behave/build.gradle | 6 +++++- experimental/build.gradle | 6 +++++- experimental/corda-utils/build.gradle | 6 +++++- finance/contracts/build.gradle | 6 +++++- finance/workflows/build.gradle | 7 ++++++- node-api/build.gradle | 6 +++++- node/build.gradle | 7 ++++++- samples/attachment-demo/build.gradle | 8 +++++++- samples/bank-of-corda-demo/build.gradle | 6 +++++- samples/irs-demo/build.gradle | 8 +++++++- .../irs-demo/cordapp/contracts-irs/build.gradle | 6 +++++- .../irs-demo/cordapp/workflows-irs/build.gradle | 8 +++++++- samples/simm-valuation-demo/build.gradle | 8 +++++++- samples/trader-demo/build.gradle | 8 +++++++- samples/trader-demo/workflows-trader/build.gradle | 8 +++++++- serialization/build.gradle | 8 ++++++-- testing/node-driver/build.gradle | 6 +++++- testing/test-cli/build.gradle | 8 +++++++- testing/test-common/build.gradle | 7 ++++++- tools/demobench/build.gradle | 7 ++++++- tools/explorer/build.gradle | 8 +++++++- tools/shell/build.gradle | 7 ++++++- tools/worldmap/build.gradle | 6 +++++- webserver/build.gradle | 7 ++++++- 36 files changed, 216 insertions(+), 36 deletions(-) diff --git a/build.gradle b/build.gradle index 3f9069a3de..afecfd8cf1 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,14 @@ buildscript { ext.netty_version = '4.1.22.Final' ext.typesafe_config_version = constants.getProperty("typesafeConfigVersion") ext.fileupload_version = '1.3.3' + // Legacy JUnit 4 version ext.junit_version = '4.12' + // Need this version to access classpath scanning error handling fix - + // see https://github.com/junit-team/junit5/commit/389de48c2a18c5a93a7203ef424aa47a8a835a74 + // Upgrade to 5.5.x when GA release is available. + ext.junit_vintage_version = '5.5.0-M1' + ext.junit_jupiter_version = '5.5.0-M1' + ext.junit_platform_version = '1.4.2' ext.mockito_version = '2.18.3' ext.mockito_kotlin_version = '1.5.0' ext.hamkrest_version = '1.4.2.2' @@ -461,6 +468,8 @@ if (file('corda-docs-only-build').exists() || (System.getenv('CORDA_DOCS_ONLY_BU } } + + wrapper { gradleVersion = "4.10.1" distributionType = Wrapper.DistributionType.ALL diff --git a/client/jackson/build.gradle b/client/jackson/build.gradle index be0b324ed2..be0cca213f 100644 --- a/client/jackson/build.gradle +++ b/client/jackson/build.gradle @@ -18,8 +18,15 @@ dependencies { testCompile project(':test-utils') testCompile project(path: ':core', configuration: 'testArtifacts') + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testCompile "junit:junit:$junit_version" + } jar { diff --git a/client/jfx/build.gradle b/client/jfx/build.gradle index 1977987329..d2aa470112 100644 --- a/client/jfx/build.gradle +++ b/client/jfx/build.gradle @@ -44,7 +44,12 @@ dependencies { compile "org.apache.activemq:artemis-core-client:${artemis_version}" // Unit testing helpers. - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:${assertj_version}" testCompile project(':test-utils') diff --git a/client/mock/build.gradle b/client/mock/build.gradle index 52f9d9943d..910a4edd43 100644 --- a/client/mock/build.gradle +++ b/client/mock/build.gradle @@ -13,8 +13,13 @@ dependencies { compile project(':finance:workflows') compile project(':finance:contracts') + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + // Unit testing helpers. - testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:${assertj_version}" testCompile project(':test-utils') diff --git a/client/rpc/build.gradle b/client/rpc/build.gradle index 5d0eb0a662..b734eabc55 100644 --- a/client/rpc/build.gradle +++ b/client/rpc/build.gradle @@ -74,9 +74,14 @@ dependencies { // For caches rather than guava compile "com.github.ben-manes.caffeine:caffeine:$caffeine_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + // Unit testing helpers. testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:${assertj_version}" testCompile project(':node-driver') diff --git a/common/configuration-parsing/build.gradle b/common/configuration-parsing/build.gradle index 9445cbd417..39eb327ab4 100644 --- a/common/configuration-parsing/build.gradle +++ b/common/configuration-parsing/build.gradle @@ -10,9 +10,14 @@ dependencies { compile group: "com.typesafe", name: "config", version: typesafe_config_version compile project(":common-validation") + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testCompile "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" testCompile group: "org.jetbrains.kotlin", name: "kotlin-test", version: kotlin_version - testCompile group: "junit", name: "junit", version: junit_version testCompile group: "org.assertj", name: "assertj-core", version: assertj_version } diff --git a/confidential-identities/build.gradle b/confidential-identities/build.gradle index 23975be04d..01a0d2f18e 100644 --- a/confidential-identities/build.gradle +++ b/confidential-identities/build.gradle @@ -12,7 +12,11 @@ dependencies { cordaCompile project(':core') testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // Guava: Google test library (collections test suite) testCompile "com.google.guava:guava-testlib:$guava_version" diff --git a/core-deterministic/testing/data/build.gradle b/core-deterministic/testing/data/build.gradle index 9165b83dde..765aa27193 100644 --- a/core-deterministic/testing/data/build.gradle +++ b/core-deterministic/testing/data/build.gradle @@ -12,7 +12,12 @@ dependencies { testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testCompile "org.jetbrains.kotlin:kotlin-reflect" - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } jar.enabled = false diff --git a/core-deterministic/testing/verifier/build.gradle b/core-deterministic/testing/verifier/build.gradle index 259a9c3110..c3f5c6caa4 100644 --- a/core-deterministic/testing/verifier/build.gradle +++ b/core-deterministic/testing/verifier/build.gradle @@ -21,6 +21,7 @@ dependencies { // Compile against the deterministic artifacts to ensure that we use only the deterministic API subset. compileOnly configurations.deterministicArtifacts api "junit:junit:$junit_version" + api "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" } jar { diff --git a/core/build.gradle b/core/build.gradle index 7ab4a50ff8..3f27a92c6b 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -54,7 +54,12 @@ processSmokeTestResources { } dependencies { - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "commons-fileupload:commons-fileupload:$fileupload_version" // Guava: Google test library (collections test suite) @@ -87,9 +92,14 @@ dependencies { compile "com.github.ben-manes.caffeine:caffeine:$caffeine_version" // Smoke tests do NOT have any Node code on the classpath! + smokeTestImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + smokeTestCompile "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + smokeTestRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + smokeTestRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + smokeTestCompile project(':smoke-test-utils') smokeTestCompile "org.assertj:assertj-core:${assertj_version}" - smokeTestCompile "junit:junit:$junit_version" // RxJava: observable streams of events. compile "io.reactivex:rxjava:$rxjava_version" diff --git a/djvm/djvm/build.gradle b/djvm/djvm/build.gradle index 1c329cf704..ce5c267377 100644 --- a/djvm/djvm/build.gradle +++ b/djvm/djvm/build.gradle @@ -33,9 +33,10 @@ dependencies { // ClassGraph: classpath scanning shadow "io.github.classgraph:classgraph:$class_graph_version" + + testCompile "junit:junit:${junit_version}" // Test utilities - testImplementation "junit:junit:$junit_version" testImplementation "org.assertj:assertj-core:$assertj_version" testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version" jdkRt "net.corda:deterministic-rt:latest.integration" diff --git a/experimental/avalanche/build.gradle b/experimental/avalanche/build.gradle index 2e7c1970ec..09f09b9228 100644 --- a/experimental/avalanche/build.gradle +++ b/experimental/avalanche/build.gradle @@ -8,7 +8,12 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "info.picocli:picocli:$picocli_version" - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } jar.enabled = false diff --git a/experimental/behave/build.gradle b/experimental/behave/build.gradle index d124b6ac39..e2017ded0a 100644 --- a/experimental/behave/build.gradle +++ b/experimental/behave/build.gradle @@ -64,8 +64,12 @@ dependencies { compile project(':client:rpc') // Unit Tests + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" - testCompile "junit:junit:$junit_version" + testCompile "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" // Scenarios / End-to-End Tests diff --git a/experimental/build.gradle b/experimental/build.gradle index 482f6e233a..d68097a60e 100644 --- a/experimental/build.gradle +++ b/experimental/build.gradle @@ -20,6 +20,10 @@ dependencies { compile "com.google.guava:guava:$guava_version" - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" testCompile project(':node-driver') } diff --git a/experimental/corda-utils/build.gradle b/experimental/corda-utils/build.gradle index 5241311783..8a5f44e734 100644 --- a/experimental/corda-utils/build.gradle +++ b/experimental/corda-utils/build.gradle @@ -23,5 +23,9 @@ dependencies { testCompile project(':test-utils') testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } diff --git a/finance/contracts/build.gradle b/finance/contracts/build.gradle index f49b03a462..5c516aae6b 100644 --- a/finance/contracts/build.gradle +++ b/finance/contracts/build.gradle @@ -14,7 +14,11 @@ dependencies { testCompile project(':test-utils') testCompile project(path: ':core', configuration: 'testArtifacts') - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // AssertJ: for fluent assertions for testing testCompile "org.assertj:assertj-core:$assertj_version" diff --git a/finance/workflows/build.gradle b/finance/workflows/build.gradle index 9505e4f9a7..94efb40b98 100644 --- a/finance/workflows/build.gradle +++ b/finance/workflows/build.gradle @@ -36,7 +36,12 @@ dependencies { testCompile project(':test-utils') testCompile project(path: ':core', configuration: 'testArtifacts') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // AssertJ: for fluent assertions for testing testCompile "org.assertj:assertj-core:$assertj_version" diff --git a/node-api/build.gradle b/node-api/build.gradle index e75f60cffd..92fe2b01ee 100644 --- a/node-api/build.gradle +++ b/node-api/build.gradle @@ -38,8 +38,12 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" runtime 'com.mattbertolini:liquibase-slf4j:2.0.0' + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // Unit testing helpers. - testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:$assertj_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" testCompile project(':node-driver') diff --git a/node/build.gradle b/node/build.gradle index 8357d4b3c9..8f845bb727 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -128,8 +128,13 @@ dependencies { // TypeSafe Config: for simple and human friendly config files. compile "com.typesafe:config:$typesafe_config_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + // Unit testing helpers. - testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:${assertj_version}" testCompile project(':test-utils') testCompile project(':client:jfx') diff --git a/samples/attachment-demo/build.gradle b/samples/attachment-demo/build.gradle index 076d78848b..3f86cb6874 100644 --- a/samples/attachment-demo/build.gradle +++ b/samples/attachment-demo/build.gradle @@ -54,7 +54,13 @@ dependencies { // and we don't need another one. exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl' } - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" integrationTestCompile project(':webserver') diff --git a/samples/bank-of-corda-demo/build.gradle b/samples/bank-of-corda-demo/build.gradle index d586e8e2c7..0471bc40ac 100644 --- a/samples/bank-of-corda-demo/build.gradle +++ b/samples/bank-of-corda-demo/build.gradle @@ -25,7 +25,11 @@ dependencies { compile "org.glassfish.jersey.core:jersey-server:${jersey_version}" // Test dependencies - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } def nodeTask = tasks.getByPath(':node:capsule:assemble') diff --git a/samples/irs-demo/build.gradle b/samples/irs-demo/build.gradle index 9a299ed5f1..6fcca35c75 100644 --- a/samples/irs-demo/build.gradle +++ b/samples/irs-demo/build.gradle @@ -69,7 +69,13 @@ dependencies { } testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:${assertj_version}" integrationTestCompile project(path: ":samples:irs-demo:web", configuration: "demoArtifacts") diff --git a/samples/irs-demo/cordapp/contracts-irs/build.gradle b/samples/irs-demo/cordapp/contracts-irs/build.gradle index 0d01b66393..c2db84e524 100644 --- a/samples/irs-demo/cordapp/contracts-irs/build.gradle +++ b/samples/irs-demo/cordapp/contracts-irs/build.gradle @@ -11,7 +11,11 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:${jackson_version}" testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } cordapp { diff --git a/samples/irs-demo/cordapp/workflows-irs/build.gradle b/samples/irs-demo/cordapp/workflows-irs/build.gradle index 9910cdca83..579bc81a04 100644 --- a/samples/irs-demo/cordapp/workflows-irs/build.gradle +++ b/samples/irs-demo/cordapp/workflows-irs/build.gradle @@ -24,7 +24,13 @@ dependencies { compile group: 'commons-io', name: 'commons-io', version: '2.5' testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:${assertj_version}" cordapp project(':samples:irs-demo:cordapp:contracts-irs') diff --git a/samples/simm-valuation-demo/build.gradle b/samples/simm-valuation-demo/build.gradle index 73fb8d5fd3..9a929d56c7 100644 --- a/samples/simm-valuation-demo/build.gradle +++ b/samples/simm-valuation-demo/build.gradle @@ -58,7 +58,13 @@ dependencies { // Test dependencies testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" } diff --git a/samples/trader-demo/build.gradle b/samples/trader-demo/build.gradle index 1bb8e089b6..d73c3507d8 100644 --- a/samples/trader-demo/build.gradle +++ b/samples/trader-demo/build.gradle @@ -55,7 +55,13 @@ dependencies { // and we don't need another one. exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl' } - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" } diff --git a/samples/trader-demo/workflows-trader/build.gradle b/samples/trader-demo/workflows-trader/build.gradle index 5207820e62..28d467f7c5 100644 --- a/samples/trader-demo/workflows-trader/build.gradle +++ b/samples/trader-demo/workflows-trader/build.gradle @@ -11,7 +11,13 @@ dependencies { cordapp project(':finance:workflows') testCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" } diff --git a/serialization/build.gradle b/serialization/build.gradle index fc1275c382..c1f184ac78 100644 --- a/serialization/build.gradle +++ b/serialization/build.gradle @@ -28,8 +28,12 @@ dependencies { // For caches rather than guava compile "com.github.ben-manes.caffeine:caffeine:$caffeine_version" - // Unit testing helpers. - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.assertj:assertj-core:$assertj_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" testCompile project(':node-driver') diff --git a/testing/node-driver/build.gradle b/testing/node-driver/build.gradle index 83853a85a7..82bf9c1154 100644 --- a/testing/node-driver/build.gradle +++ b/testing/node-driver/build.gradle @@ -29,7 +29,11 @@ dependencies { // Integration test helpers testCompile "org.assertj:assertj-core:$assertj_version" - integrationTestCompile "junit:junit:$junit_version" + integrationTestImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + integrationTestImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + integrationTestRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + integrationTestRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // Jetty dependencies for NetworkMapClient test. // Web stuff: for HTTP[S] servlets diff --git a/testing/test-cli/build.gradle b/testing/test-cli/build.gradle index 3d32512119..e49370c617 100644 --- a/testing/test-cli/build.gradle +++ b/testing/test-cli/build.gradle @@ -7,7 +7,13 @@ dependencies { compile group: "com.fasterxml.jackson.dataformat", name: "jackson-dataformat-yaml", version: "2.9.0" compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.9.0" compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+" - compile "junit:junit:$junit_version" + + compile "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + compile "junit:junit:${junit_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } compileKotlin { diff --git a/testing/test-common/build.gradle b/testing/test-common/build.gradle index e81dd16090..8fcb6e638a 100644 --- a/testing/test-common/build.gradle +++ b/testing/test-common/build.gradle @@ -9,7 +9,12 @@ dependencies { compile project(":common-logging") // Unit testing helpers. - compile "junit:junit:$junit_version" + compile "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + compile 'org.hamcrest:hamcrest-library:1.3' compile "com.nhaarman:mockito-kotlin:$mockito_kotlin_version" compile "org.mockito:mockito-core:$mockito_version" diff --git a/tools/demobench/build.gradle b/tools/demobench/build.gradle index f7e8190dc3..7760921d18 100644 --- a/tools/demobench/build.gradle +++ b/tools/demobench/build.gradle @@ -74,7 +74,12 @@ dependencies { testCompile project(':test-utils') testCompile project(':webserver') - testCompile "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" testCompile "org.assertj:assertj-core:$assertj_version" } diff --git a/tools/explorer/build.gradle b/tools/explorer/build.gradle index add342ec68..f2b55ee8b6 100644 --- a/tools/explorer/build.gradle +++ b/tools/explorer/build.gradle @@ -7,8 +7,14 @@ mainClassName = 'net.corda.explorer.Main' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testCompile "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testCompile "junit:junit:$junit_version" // TornadoFX: A lightweight Kotlin framework for working with JavaFX UI's. compile 'no.tornado:tornadofx:1.5.9' diff --git a/tools/shell/build.gradle b/tools/shell/build.gradle index 8fef472421..4acae9e074 100644 --- a/tools/shell/build.gradle +++ b/tools/shell/build.gradle @@ -54,8 +54,13 @@ dependencies { // For logging, required for ANSIProgressRenderer. compile "org.apache.logging.log4j:log4j-core:$log4j_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" + // Unit testing helpers. - testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:$assertj_version" testCompile project(':test-utils') testCompile project(':finance:contracts') diff --git a/tools/worldmap/build.gradle b/tools/worldmap/build.gradle index 7ccf067acb..e4618738e6 100644 --- a/tools/worldmap/build.gradle +++ b/tools/worldmap/build.gradle @@ -4,5 +4,9 @@ dependencies { implementation project(':core') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation "org.jetbrains.kotlin:kotlin-test-junit" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } \ No newline at end of file diff --git a/webserver/build.gradle b/webserver/build.gradle index ca228a9800..39b096d4ea 100644 --- a/webserver/build.gradle +++ b/webserver/build.gradle @@ -61,7 +61,12 @@ dependencies { compileOnly "co.paralleluniverse:capsule:$capsule_version" integrationTestCompile project(':node-driver') - testCompile "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" + + testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" } task integrationTest(type: Test) {