Commit 712b3b0
fix: Replace hashCode with sequential counters in test builders
Address Copilot PR feedback to fix potential ID collision issues:
- UserTestDataBuilder: Use roleIdCounter instead of roleName.hashCode()
- RoleTestDataBuilder: Use privilegeIdCounter instead of privilegeName.hashCode()
- Added separate counters starting at different ranges to avoid conflicts
- roleIdCounter starts at 1000L
- privilegeIdCounter starts at 2000L
This prevents potential test flakiness from hashCode collisions
and provides more predictable test data generation.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a6d6cc0 commit 712b3b0
2 files changed
Lines changed: 4 additions & 2 deletions
File tree
- src/test/java/com/digitalsanctuary/spring/user/test/builders
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | | - | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
0 commit comments