Make business rules explicit, not buried in code.
One method, multiple scenarios.
@Test
void notDivisibleBy4() {
assertFalse(Year.isLeap(2001));
}
@Test
void divisibleBy4() {
assertTrue(Year.isLeap(2004));
}
@Test
void divisibleBy100ButNotBy400() {
assertFalse(Year.isLeap(2100));
}
@Test
void divisibleBy400() {
assertTrue(Year.isLeap(2000));
}@TableTest("""
Scenario | Year | Leap?
Not divisible by 4 | 2001 | false
Divisible by 4 | 2004 | true
Divisible by 100 but not by 400 | 2100 | false
Divisible by 400 | 2000 | true
""")
void leapYear(int year, boolean leap) {
assertEquals(leap, Year.isLeap(year));
}Same coverage. Less code. Add test cases by adding rows.
The table format makes test scenarios readable by anyone on the team. Business rules are explicit, not buried in code.
Scannable tables reveal coverage gaps at a glance. Adding a scenario is just adding a row.
IntelliJ plugin for formatting and syntax highlighting, plus a CLI formatter and test reporter.
A JUnit extension, not a separate framework. Use the same assertions, mocking frameworks, and test utilities you already know.
Write table-driven tests in either language. Same annotation, same table format.
Works with your existing test runner and build tool. Supports Spring Boot and Quarkus.