You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/migrate-groovy-to-java/SKILL.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
---
2
2
name: migrate-groovy-to-java
3
-
description: migrate test groovy files to java
3
+
description: >
4
+
Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests.
5
+
Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module
6
+
has .groovy test files that need to be replaced with .java equivalents.
4
7
---
5
8
6
9
Migrate test Groovy files to Java using JUnit 5
@@ -18,6 +21,8 @@ When converting Groovy code to Java code, make sure that:
18
21
- Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first `Arguments.arguments(...)` value or index the test case
19
22
- When converting tuples, create a light dedicated structure instead to keep the typing system
20
23
- Instead of checking a state and throwing an exception, use JUnit asserts
24
+
- Instead of using `assertTrue(a.equals(b))` or `assertFalse(a.equals(b))`, use `assertEquals(expected, actual)` and `assertNotEquals(unexpected, actual)`
25
+
- Import frequently used types rather than using fully-qualified names inline, to improve readability
21
26
- Do not wrap checked exceptions and throw a Runtime exception; prefer adding a throws clause at method declaration
22
27
- Do not mark local variables `final`
23
28
- Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times
0 commit comments