Skip to content

Commit 2ef6967

Browse files
authored
Merge branch 'master' into alejandro.gonzalez/RFC-1081
2 parents 34555b8 + 0eb2234 commit 2ef6967

47 files changed

Lines changed: 3524 additions & 2606 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: migrate-groovy-to-java
3+
description: migrate test groovy files to java
4+
---
5+
6+
Migrate test Groovy files to Java using JUnit 5
7+
8+
1. List all groovy files of the current gradle module
9+
2. convert groovy files to Java using Junit 5
10+
3. make sure the tests are still passing after migration
11+
4. remove groovy files
12+
13+
When converting groovy code to java code make sure that:
14+
- the Java code generated is compatible with JDK 8
15+
- when translating Spock test, favor using `@CsvSource` with `|` delimiters
16+
- when using a `@MethodSource`, use the test method name, and suffix it with `_arguments`
17+
- when converting tuples, create light dedicated structure instead to keep the typing system
18+
- Instead of checking a state and throwing an exception, use JUnit asserts
19+
- Do not wrap checked exception and throwing a Runtime exception, prefer adding a throws clause at method declaration
20+
- Do not mark local variables `final`

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
java
3-
groovy
43
id("com.diffplug.spotless") version "8.2.1"
54
id("com.gradleup.shadow") version "8.3.9"
65
}
@@ -34,8 +33,9 @@ dependencies {
3433
implementation(libs.javaparser.symbol.solver)
3534

3635
testImplementation(libs.bytebuddy)
37-
testImplementation(libs.bundles.groovy)
38-
testImplementation(libs.bundles.spock)
36+
testImplementation(libs.bundles.junit5)
37+
testRuntimeOnly(libs.junit.platform.launcher)
38+
testImplementation(libs.bundles.mockito)
3939
testImplementation("javax.servlet", "javax.servlet-api", "3.0.1")
4040
testImplementation(libs.spotbugs.annotations)
4141
}

0 commit comments

Comments
 (0)