Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
matchCurrentValue: "/^5\\./",
allowedVersions: "(,6.0)"
},
{
matchPackageNames: ["/^org.junit:/"],
matchCurrentValue: "/^5\\./",
allowedVersions: "(,6.0)"
},
{
matchPackageNames: ["/^org.junit:/"],
matchCurrentValue: "/^6\\./",
allowedVersions: "(,7.0)"
},
{
matchPackageNames: ["/^org.mockito:/"],
matchCurrentValue: "/^4\\./",
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ subprojects {
dependencies {
api platform(projects.spockBom)
implementation(project.name == "spock-gradle" ? [] : groovylibs.groovy)
testImplementation(platform(libs.junit.bom))
testImplementation(platform(libs.junit5.bom))
testImplementation(libs.junit.platform.launcher)
}

Expand Down
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ groovy3 = '3.0.25'
groovy4 = '4.0.29'
groovy5 = '5.0.2'
jacoco = '0.8.14'
junit = '5.14.1'
junit5 = '5.14.1'
junit6 = '6.0.1'
# The VersionRange used by OSGi to check compatibility with JUnit Platform.
junitPlatformVersionRange = "[1.12,7)"
asm = '9.9'
Expand All @@ -32,7 +33,8 @@ mockito5 = { module = "org.mockito:mockito-core", version.ref = "mockito5" }
objenesis = "org.objenesis:objenesis:3.4"
# This needs a classifier, but it has to be specified on the usage end https://melix.github.io/blog/2021/03/version-catalogs-faq.html#_why_can_t_i_use_excludes_or_classifiers
jacoco-agent = { module = "org.jacoco:org.jacoco.agent", version.ref = "jacoco" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
junit5-bom = { module = "org.junit:junit-bom", version.ref = "junit5" }
junit6-bom = { module = "org.junit:junit-bom", version.ref = "junit6" }
# to omit the version we have to use this syntax, the version is managed by the junit-bom
junit-jupiter.module = "org.junit.jupiter:junit-jupiter"
junit-platform-console.module = "org.junit.platform:junit-platform-console"
Expand Down
2 changes: 1 addition & 1 deletion spock-core/core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ configurations {

dependencies {
api groovylibs.groovy // easiest way to add Groovy dependency to POM
api platform(libs.junit.bom)
api platform(libs.junit5.bom)
api 'org.junit.platform:junit-platform-engine'
api libs.hamcrest
if (variant == 2.5) {
Expand Down
2 changes: 1 addition & 1 deletion spock-spring/boot2-test/boot2-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencyManagement {
}

// Spring dependency management downgrades the jupiter version to 5.7.2 otherwise
ext['junit-jupiter.version'] = libs.versions.junit.get()
ext['junit-jupiter.version'] = libs.versions.junit5.get()

dependencies {
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
Expand Down
2 changes: 1 addition & 1 deletion spock-spring/boot3-test/boot3-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

// Spring dependency management downgrades the jupiter version to 5.7.2 otherwise
ext['junit-jupiter.version'] = libs.versions.junit.get()
ext['junit-jupiter.version'] = libs.versions.junit5.get()

java {
toolchain {
Expand Down
45 changes: 34 additions & 11 deletions spock-testkit/testkit.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
ext.displayName = "Spock Framework - Temp Specs for Core Module"
plugins {
id 'jvm-test-suite'
}

//configurations {
// junit
//}
ext.displayName = "Spock Framework - Spock TestKit Specs for Core Module"

dependencies {
api projects.spockCore

testRuntimeOnly libs.asm
testRuntimeOnly libs.bytebuddy
testRuntimeOnly libs.cglib
testRuntimeOnly libs.objenesis
testRuntimeOnly libs.h2database
testRuntimeOnly libs.junit.platform.console
testImplementation libs.junit.platform.testkit

testImplementation libs.junit.platform.testkit
testImplementation libs.junit.jupiter
}

tasks.named("test", Test) {
tasks.withType(Test).configureEach {
reports.junitXml.required = true
reports.html.required = false

Expand All @@ -43,3 +38,31 @@ tasks.register("consoleLauncherTest", JavaExec) {
args("--reports-dir", reportsDir)
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
}


if (javaVersion >= 17) {
testing {
suites {
junit6Test(JvmTestSuite) {
useJUnitJupiter(libs.versions.junit6)
sources {
groovy {
srcDirs = ['src/test/groovy']
}
}

dependencies {
implementation projects.spockCore

implementation platform(libs.junit6.bom)
implementation libs.junit.platform.testkit
implementation libs.junit.jupiter
}
}
}
}

tasks.named('check') {
dependsOn(testing.suites.junit6Test)
}
}