一键导入
migrate-junit-source-to-tabletest
Convert JUnit 5 @MethodSource/@CsvSource/@ValueSource parameterized tests to @TableTest (JDK8)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert JUnit 5 @MethodSource/@CsvSource/@ValueSource parameterized tests to @TableTest (JDK8)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review a code diff / branch / PR for technical debt — code duplication, unnecessary complexity / over-engineering, and redundant or dead code. Use whenever the user wants a tech-debt, cleanup, or refactor review, asks to check a branch or PR for duplication / complexity / dead code before opening a PR, or mentions "techdebt". Refactor-only: it reports issues and offers behavior-preserving fixes; it never changes behavior.
Write a new library instrumentation end-to-end. Use when the user ask to add a new APM integration or a library instrumentation.
Performance-overhead review of a code diff / branch / PR for the dd-trace-java tracer. Flags hot-path allocation, unbounded memory, repeated work, escaping objects, native-boundary crossings, and JVM-specific pitfalls (escape analysis, JNI / virtual-thread pinning, backtracking-regex ReDoS, varargs/boxing hashing, String.format, ByteBuddy-Advice anti-patterns) using the tracer performance rubric. Use whenever the user wants a performance / overhead / hot-path review, asks to check a diff or PR for allocation / GC / memory / latency / startup cost, or mentions the "perf rubric" or the "do no harm / assume hot" tracer posture — even if they just say "review this for perf" without naming the rubric. Advisory and READ-ONLY: it reports ranked, verify-first findings; it never edits code.
Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module has .groovy test files that need to be replaced with .java equivalents.
Post-migration quality review. Checks Java test files produced by migrate-groovy-to-java against the shared quality rules. Use after migration, or on any branch with recently migrated .java test files. Produces structured FINDING blocks grouped by severity, then offers to auto-fix BLOCKERs and WARNINGs.
| name | migrate-junit-source-to-tabletest |
| description | Convert JUnit 5 @MethodSource/@CsvSource/@ValueSource parameterized tests to @TableTest (JDK8) |
Goal: Migrate JUnit 5 parameterized tests using @MethodSource/@CsvSource/@ValueSource to @TableTest with minimal churn and passing tests.
Process (do in this order):
Import: import org.tabletest.junit.TableTest;
JDK 8 rules:
@TableTest({
"a | b",
"1 | 2"
})
Table formatting rules (mandatory):
{a, b, c}) instead of matrix-style repetition when only one dimension varies across otherwise-identical rows.Conversions: A) @CsvSource
B) @ValueSource
@ValueSource (and @NullSource when null cases are needed).C) @MethodSource (convert only if values are representable as strings)
@TableTest and @MethodSource may be combined on the same @ParameterizedTest when most cases are tabular but a few cases require programmatic setup.@TableTest, and put only non-tabular/complex cases in @MethodSource.@TableTest is not viable for the test at all, use @MethodSource only.@MethodSource, name the arguments method <testMethodName>Arguments (camelCase, e.g. testMethodArguments) and return Stream<Arguments> using Stream.of(...) and arguments(...) with static import.D) @TypeConverter
@TypeConverter for symbolic constants used by migrated table rows (e.g. Long.MAX_VALUE, DDSpanId.MAX).utils/test-utils) when reuse across modules is likely.Scenario handling:
Cleanup:
Mixed eligibility:
@TableTest + @MethodSource on one @ParameterizedTest when only some cases are complex.Do NOT convert when:
Test command (exact): ./gradlew :path:to:module:test --rerun-tasks 2>&1 | tail -20