[Tests] Add unit tests for player events, CorePlayer, database records, CorePlayerOfflineException#32
[Tests] Add unit tests for player events, CorePlayer, database records, CorePlayerOfflineException#32DiamondDagger590 wants to merge 1 commit into
Conversation
…orePlayerOfflineException Test coverage for 8 classes: - PlayerLoadEvent, PlayerUnloadEvent, PlayerSettingChangeEvent, CorePlayerEvent (0% -> 100%) - CorePlayer (20% -> 66.7%) - Credentials, ConnectionDetails (0% -> 100%) - CorePlayerOfflineException (0% -> 100%) Overall line coverage: 27.0% -> 28.1% https://claude.ai/code/session_012EzjJy84uWQ59EwcB2mjAX
Extensibility ReviewBreaking change risk: NONE — this diff adds only test classes with no changes to production source files. The entire diff consists of new files added under A brief scan of each test file confirms:
No extensibility concerns found. |
Testing ReviewI'll systematically apply every checklist item to the diff, examining both the new test files and the production classes they target. AnalysisProduction Classes Under Test (inferred from test targets)
Test Files Present
FindingsCONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: No test covers CONCERN: SummaryProduction files changed: Test files present: Coverage gaps:
|
Security ReviewNo security concerns found. The diff contains exclusively test code ( |
|
Warning Review limit reached
More reviews will be available in 53 minutes and 30 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
getCorePlayer(), instance/static handler list identity, and cross-event handler list isolation (both 0% → 100% line coverage)getOldSetting()with null and non-null values,getNewSetting(), handler list identity, and cross-event handler list isolation with PlayerLoadEvent (0% → 100% line coverage)getCorePlayer()getter and UUID preservation (75% → 100% line coverage)getUUID(),getPlugin(),getStatisticData(),getPlayerSettings()(empty),getPlayerSetting()(absent key),useMutex()(both true/false),isAfk()with no hooks registered,equals()(same UUID, different UUID, self, non-CorePlayer, null),hashCode()consistency, andtoString()format (20% → 66.7% line coverage; remaining 33% are Bukkit-dependent methods:getAsBukkitPlayer(),setPlayerSetting())getCorePlayer()accessor, and RuntimeException inheritance (0% → 100% line coverage)Classes covered (avoiding PR #27, PR #28, PR #29, PR #30, and PR #31 overlap)
PR #27 covers GetItemRequest, StatisticEntry, ReloadableContent, ReloadableContentManager, StartupProfile. PR #28 covers Methods, PlayerSettingRegistry, ReloadableContent subtypes. PR #29 covers Mutexable, ParseError, EvaluationException, and exception classes. PR #30 covers RegistryAccess, StatisticModifyEvent, PostStatisticModifyEvent, Transaction. PR #31 covers database events, GUI events, SQLiteDatabaseDriver, DatabaseDriver, ManagerKey/PluginHookKey constants. This PR targets entirely different classes with no overlap.
Coverage impact
8 classes improved: 7 brought from 0% to 100% line coverage, 1 improved from 20% to 66.7%. Overall project coverage: 27.0% → 28.1%.
Test plan
./gradlew testhttps://claude.ai/code/session_012EzjJy84uWQ59EwcB2mjAX
Generated by Claude Code