Convert JUnit 5 @MethodSource/@CsvSource/@ValueSource parameterized tests to @TableTest (JDK8)
84
80%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.claude/skills/migrate-junit-source-to-tabletest/SKILL.mdGoal: 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
4ee2247
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.