Skip to content

Commit 4f184be

Browse files
committed
Stop using JUnit 4 rules
1 parent 1d460fa commit 4f184be

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
plugins {
3-
id 'com.netflix.nebula.plugin-plugin' version '22.0.2'
3+
id 'com.netflix.nebula.plugin-plugin' version '24.0.5'
44
id "org.jetbrains.kotlin.jvm" version "2.2.0"
55
}
66

@@ -14,6 +14,7 @@ dependencies {
1414
testImplementation 'cglib:cglib-nodep:3.2.4'
1515
testImplementation 'org.apache.commons:commons-io:1.3.2'
1616
testImplementation 'uk.org.webcompere:system-stubs-junit4:2.0.1'
17+
integTestImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
1718
}
1819

1920
contacts {

gradle.lockfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ commons-io:commons-io:1.3.2=integTestCompileClasspath,integTestRuntimeClasspath,
1111
net.bytebuddy:byte-buddy-agent:1.11.13=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
1212
net.bytebuddy:byte-buddy:1.15.11=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
1313
org.apache.commons:commons-io:1.3.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
14+
org.apache.groovy:groovy:4.0.4=integTestCompileClasspath,integTestRuntimeClasspath
1415
org.apiguardian:apiguardian-api:1.1.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
1516
org.assertj:assertj-core:3.27.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
17+
org.hamcrest:hamcrest:2.2=integTestCompileClasspath,integTestRuntimeClasspath
1618
org.jetbrains.kotlin:kotlin-stdlib:2.2.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1719
org.jetbrains:annotations:13.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1820
org.jspecify:jspecify:1.0.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -23,6 +25,7 @@ org.mockito:mockito-core:3.12.4=integTestCompileClasspath,integTestRuntimeClassp
2325
org.mockito:mockito-inline:3.12.4=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2426
org.objenesis:objenesis:3.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2527
org.opentest4j:opentest4j:1.3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
28+
org.spockframework:spock-core:2.3-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath
2629
uk.org.webcompere:system-stubs-core:2.0.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2730
uk.org.webcompere:system-stubs-junit4:2.0.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2831
empty=annotationProcessor,integTestAnnotationProcessor,testAnnotationProcessor

src/integTest/groovy/com/moowork/gradle/AbstractIntegTest.groovy

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ import org.apache.commons.io.FileUtils
44
import org.gradle.testkit.runner.BuildResult
55
import org.gradle.testkit.runner.BuildTask
66
import org.gradle.testkit.runner.GradleRunner
7-
import org.junit.Rule
8-
import org.junit.rules.TemporaryFolder
97
import spock.lang.Specification
8+
import spock.lang.TempDir
109

1110
abstract class AbstractIntegTest
1211
extends Specification {
13-
@Rule
14-
final TemporaryFolder temporaryFolder = new TemporaryFolder();
12+
@TempDir
13+
File temporaryFolder
1514

1615
def File projectDir;
1716

1817
def File buildFile;
1918

2019
def setup() {
21-
this.projectDir = this.temporaryFolder.root;
20+
this.projectDir = this.temporaryFolder;
2221
this.buildFile = createFile('build.gradle')
2322
// Enable configuration cache :)
2423
new File(projectDir, 'gradle.properties') << '''org.gradle.configuration-cache=true'''.stripIndent()
@@ -53,7 +52,7 @@ abstract class AbstractIntegTest
5352
}
5453

5554
protected final File createFile(final String name) {
56-
return new File(this.temporaryFolder.getRoot(), name);
55+
return new File(this.temporaryFolder, name);
5756
}
5857

5958
protected final void writeFile(final String name, final String text) {

0 commit comments

Comments
 (0)