Add parameterized module: JUnit 5 @ParameterizedTest argument sources, display names, and two real anti-pattern failures

This commit is contained in:
Claude
2026-10-03 21:50:52 +00:00
parent 8be1245951
commit ee75bfa792
45 changed files with 1179 additions and 0 deletions
@@ -0,0 +1,25 @@
Captured from a real `junit-platform-console-standalone --details=tree` run against
EnumSourceTest, compiled and executed for real.
╷
├─ JUnit Platform Suite ✔
├─ JUnit Jupiter ✔
│ └─ EnumSourceTest ✔
│ ├─ nonPrivilegedRolesMustNotWrite(Role) ✔
│ │ ├─ EDITOR must NOT have write access ✔
│ │ ├─ USER must NOT have write access ✔
│ │ └─ GUEST must NOT have write access ✔
│ └─ privilegedRolesShouldHaveWriteAccess(Role) ✔
│ ├─ ADMIN should have write access ✔
│ └─ SUPERUSER should have write access ✔
└─ JUnit Vintage ✔
Test run finished after 212 ms
[ 5 tests successful ]
[ 0 tests failed ]
Two @EnumSource tests over the same Role enum, using the two opposite selection modes:
privilegedRolesShouldHaveWriteAccess uses mode = INCLUDE with names = {"ADMIN", "SUPERUSER"},
and nonPrivilegedRolesMustNotWrite uses mode = EXCLUDE with the same two names -- so between
them every one of the five Role constants is exercised exactly once, and AuthService.canWrite's
real logic is what each assertion checks against.