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
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,11 @@ Migrate test Groovy files to Java using JUnit 5
16
16
17
17
When converting Groovy code to Java code, make sure that:
18
18
- The Java code generated is compatible with JDK 8
19
-
- When translating Spock tests, favor using @TableTest. See detailed instructions in the "TableTest Usage" section of this document.
20
-
- When usage of `@TableTest` impossible, use `@MethodSource`, and name the arguments method by appending `Arguments` using camelCase to the test method name (e.g. `testMethodArguments`) and return a `Stream` of arguments using `Stream.of(...)` and `arguments(...)` with static import.
19
+
- When translating Spock tests, prefer `@TableTest` for data rows that are naturally tabular. See detailed guidance in the "TableTest usage" section.
20
+
-`@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup.
21
+
- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`.
22
+
- If `@TableTest` is not viable for the test at all, use `@MethodSource` only.
23
+
- For `@MethodSource`, name the arguments method `<testMethodName>Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream<Arguments>` using `Stream.of(...)` and `arguments(...)` with static import.
21
24
- 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
22
25
- When converting tuples, create a light dedicated structure instead to keep the typing system
23
26
- Instead of checking a state and throwing an exception, use JUnit asserts
Copy file name to clipboardExpand all lines: .claude/skills/use-tabletest/SKILL.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,10 @@ C) @MethodSource (convert only if values are representable as strings)
48
48
- List: [a, b, ...]
49
49
- Set: {a, b, ...}
50
50
- Map: [k: v, ...]
51
+
-`@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup.
52
+
- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`.
53
+
- If `@TableTest` is not viable for the test at all, use `@MethodSource` only.
54
+
- For `@MethodSource`, name the arguments method `<testMethodName>Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream<Arguments>` using `Stream.of(...)` and `arguments(...)` with static import.
51
55
- Blank cell = null (non-primitive).
52
56
- '' = empty string.
53
57
- For String params that start with '[' or '{', quote to avoid collection parsing (prefer '[]'/'{}').
@@ -59,9 +63,8 @@ Cleanup:
59
63
- Delete now-unused @MethodSource provider methods and unused imports.
60
64
61
65
Mixed eligibility:
62
-
- If only a few cases need complex construction, split:
63
-
- Simple cases ⇒ @TableTest
64
-
- Complex cases ⇒ separate @Test(s) (descriptive names) OR keep a small @MethodSource.
66
+
- Prefer combining `@TableTest` + `@MethodSource` on one `@ParameterizedTest` when only some cases are complex.
67
+
- Use `@MethodSource`-only only when tabular representation is not practical for the test.
0 commit comments