From 0aa5533dea11993b8ccda4cb547f774094f5b707 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 13 Jul 2019 19:13:33 +0200 Subject: [PATCH] Execute test suite in Gradle using JUnit Platform Closes gh-23286 --- build.gradle | 8 ++++++++ spring-test/spring-test.gradle | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index f2f6bc0d31..4be38c7ed8 100644 --- a/build.gradle +++ b/build.gradle @@ -76,6 +76,9 @@ configure(allprojects) { project -> generatedPomCustomization { enabled = false } + imports { + mavenBom "org.junit:junit-bom:${junit5Version}" + } } configurations.all { @@ -134,6 +137,7 @@ configure(allprojects) { project -> systemProperty("java.awt.headless", "true") systemProperty("testGroups", project.properties.get("testGroups")) systemProperty("io.netty.leakDetection.level", "paranoid") + useJUnitPlatform() scanForTestClasses = false include(["**/*Tests.class", "**/*Test.class"]) // Since we set scanForTestClasses to false, we need to filter out inner @@ -165,6 +169,10 @@ configure(allprojects) { project -> testCompile("io.mockk:mockk:1.9.3") testCompile("org.hamcrest:hamcrest-all:1.3") testCompile("org.assertj:assertj-core:3.12.2") + // Pull in the latest JUnit 5 Launcher API and the Vintage engine as well + // so that we can run JUnit 4 tests in IDEs. + testRuntime("org.junit.platform:junit-platform-launcher") + testRuntime("org.junit.vintage:junit-vintage-engine") testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}") testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}") testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") diff --git a/spring-test/spring-test.gradle b/spring-test/spring-test.gradle index 58bcfefef7..096684bd8b 100644 --- a/spring-test/spring-test.gradle +++ b/spring-test/spring-test.gradle @@ -79,11 +79,7 @@ dependencies { } testCompile("io.projectreactor.netty:reactor-netty") testCompile("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1") - // Pull in the latest JUnit 5 Launcher API and the Vintage engine as well - // so that we can run JUnit 4 tests in IDEs. testRuntime("org.junit.jupiter:junit-jupiter-engine") - testRuntime("org.junit.platform:junit-platform-launcher") - testRuntime("org.junit.vintage:junit-vintage-engine") testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("com.sun.xml.bind:jaxb-core:2.3.0.1") testRuntime("com.sun.xml.bind:jaxb-impl:2.3.0.1")