[Tests] Add remaining branch coverage gaps for ManagerRegistry and Methods.lookAt#59
Conversation
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds unit tests only: new test cases for StatisticModifyEvent constructor/setter validation and cancellable behavior, RegistryAccessTest covering registration and singleton behavior, additional ManagerRegistry registered() lookup tests, and a new Methods.lookAt yaw assertion test. ChangesTest coverage additions
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Extensibility ReviewBreaking change risk: NONE — this diff contains only new test classes and additional test methods with no changes to production source files. No extensibility concerns found. The entire diff consists of:
None of these changes touch any public API surface, abstract class hierarchy, method signatures, field declarations, registry key string values, |
Testing ReviewI'll systematically apply every checklist item to the diff. AnalysisProduction files changedThe diff contains only test file additions/modifications — no production source files are changed. I must therefore evaluate whether the tests themselves are structurally sound and whether the production classes they exercise have adequate coverage. FindingsCONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: CONCERN: SummaryProduction files changed: None — this diff is test-only. Test files present:
Coverage gaps:
|
Security ReviewNo security concerns found. The diff contains exclusively test code additions and modifications — unit tests for |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/test/java/com/diamonddagger590/mccore/registry/RegistryAccessTest.java`:
- Around line 56-62: The identity check in
RegistryAccessTest.registryAccess_returnsSameInstance_whenCalledMultipleTimes
should use the purpose-built assertion instead of a raw equality comparison.
Replace the current first == second assertion with assertSame so the test
clearly expresses singleton identity and produces a better failure message; keep
the test focused on RegistryAccess.registryAccess() returning the same instance.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3df78f53-6494-4a7d-b8a6-7622cb9245e7
📒 Files selected for processing (4)
src/test/java/com/diamonddagger590/mccore/event/statistic/StatisticModifyEventTest.javasrc/test/java/com/diamonddagger590/mccore/registry/RegistryAccessTest.javasrc/test/java/com/diamonddagger590/mccore/registry/manager/ManagerRegistryTest.javasrc/test/java/com/diamonddagger590/mccore/util/MethodsTest.java
…thods.lookAt Address review feedback from PR #59 persona audit: - ManagerRegistry: add tests for registered(Manager) and registered(ManagerKey) with non-matching entries to exercise the loop-body → false path - Methods.lookAt: add test for dx=0/dz>0 branch (positive Z, same X) asserting both yaw=0 and pitch=0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014PUN8sfRgFi1k1nPoyjGqm
b994d23 to
8cf755f
Compare
…thods.lookAt Address review feedback from PR #59 persona audit: - ManagerRegistry: add tests for registered(Manager) and registered(ManagerKey) with non-matching entries to exercise the loop-body → false path - Methods.lookAt: add test for dx=0/dz>0 branch (positive Z, same X) asserting both yaw=0 and pitch=0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014PUN8sfRgFi1k1nPoyjGqm
8cf755f to
f45efa4
Compare
Extensibility ReviewBreaking change risk: NONE — this diff adds only test cases with no changes to production source code. No extensibility concerns found. Both changes are confined to the |
Testing ReviewI'll systematically apply every checklist item to the diff. AnalysisProduction files changedThe diff contains zero production file changes. Both changed files are in Test files present
Checklist ApplicationCoverage CompletenessNo new production logic was introduced, so "for every new public method" coverage requirements do not apply. However, the tests themselves can still be evaluated for structural correctness. TimeProvider UsageNeither new test touches time-based logic. No MockBukkit UsageThe CONCERN: Looking at the diff context: the existing Bukkit-Dependent vs. Pure-Java SeparationThe Framework Test QualityCONCERN: The CONCERN: The CONCERN: The two new CONCERN: The two new CONCERN: Neither new SummaryProduction files changed: None Test files present:
Coverage gaps:
Structural problems:
|
Security ReviewNo security concerns found. Both changed files are test classes only — no DAO methods, DDL constructors, MiniMessage deserialization, ChatResponse handling, |
Summary
Addresses remaining branch coverage gaps identified during PR #59 persona audit, after rebasing onto latest develop (which merged the original RegistryAccess, StatisticModifyEvent, and prior ManagerRegistry/Methods tests).
registered(Manager)andregistered(ManagerKey)with non-matching entries in the map — exercises the for-loop body returning false (rather than the empty-map short path already covered)dx == 0, dz > 0branch where yaw stays at 0 — asserts both yaw and pitch for completeness (addresses review feedback about incomplete assertions)Coverage Impact
Test plan
./gradlew test)🤖 Generated with Claude Code
https://claude.ai/code/session_014PUN8sfRgFi1k1nPoyjGqm