Add parameterized module: JUnit 5 @ParameterizedTest argument sources, display names, and two real anti-pattern failures
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user