Skip to content

[Tests] Improve coverage for ItemBuilder, Database, and LocalizationManager#73

Open
DiamondDagger590 wants to merge 1 commit into
developfrom
claude/eager-thompson-q8xuxs
Open

[Tests] Improve coverage for ItemBuilder, Database, and LocalizationManager#73
DiamondDagger590 wants to merge 1 commit into
developfrom
claude/eager-thompson-q8xuxs

Conversation

@DiamondDagger590

Copy link
Copy Markdown
Owner

Summary

  • ItemBuilderSectionTest: Add 8 tests covering previously uncovered from(Section) paths — player/skull builder, spawner mob type, potion section parsing, banner pattern parsing, item flags (with value assertion), custom model data, display name, and lore
  • DatabaseAdditionalTest: Add 6 tests covering non-blocking createTables()/updateTables() initialization path (using CompletableFuture-based synchronization instead of Thread.sleep), double-shutdown safety, accessor methods, and tableExists negative case
  • LocalizationManagerTest: Add 11 tests covering PAPI hook integration (single message + list variants), PAPI-absent branch, PAPI-present-but-no-Bukkit-player branch, broadcastMessage with loaded player / unloaded player / no online players (using mockStatic(Bukkit.class)), audience player-not-found fallback, missing locale throws, and section locale fallback

Test plan

  • All 2148 tests pass (gradle test)
  • JaCoCo coverage report generated
  • Testing audit persona reviewed changes; findings addressed (Thread.sleep replaced with CompletableFuture sync, missing broadcastMessage else-branch added, weak assertions strengthened)
  • No production code changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01KbyV2e3QBZ8qCTa5VSFaBy


Generated by Claude Code

…anager

- ItemBuilderSectionTest: Add tests for player/skull path, spawner mob
  type, potion section parsing, banner pattern parsing, item flags with
  value assertion, custom model data, display name, and lore
- DatabaseAdditionalTest: Add non-blocking initialization tests using
  CompletableFuture-based synchronization, double-shutdown safety,
  accessor tests, and tableExists negative case
- LocalizationManagerTest: Add PAPI hook integration tests (single
  message and list variants), PAPI-absent and no-Bukkit-player branch
  tests, broadcastMessage tests covering loaded/unloaded/no-player
  paths with mockStatic Bukkit, audience player-not-found fallback,
  missing locale throws, and section locale fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbyV2e3QBZ8qCTa5VSFaBy
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DiamondDagger590, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro

Run ID: fba7808a-9f4c-40e4-b9c2-ea1e28590035

📥 Commits

Reviewing files that changed from the base of the PR and between c5761e4 and e764522.

📒 Files selected for processing (3)
  • src/test/java/com/diamonddagger590/mccore/builder/item/impl/ItemBuilderSectionTest.java
  • src/test/java/com/diamonddagger590/mccore/database/DatabaseAdditionalTest.java
  • src/test/java/com/diamonddagger590/mccore/localization/LocalizationManagerTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/eager-thompson-q8xuxs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Claude finished @DiamondDagger590's task in 5m 50s —— View job


Claude PR Review

Verdict: 0 important, 3 nits

This is a test-only PR (no src/main changes), adding 25 new tests across ItemBuilderSectionTest, DatabaseAdditionalTest, and LocalizationManagerTest. Only the review-testing lens applies per the routing rules (security/extensibility lenses key off src/main changes, which are absent here). No blocking issues found.

Nits (3)
  • ItemBuilderSectionTest.java:258-309 — The new fromSection_invokesSkullBuilder_whenPlayerIsNonEmpty, ..._invokesSpawnerBuilder_..., ..._invokesPotionBuilder_..., and ..._invokesPatternBuilder_... tests only assert assertDoesNotThrow + assertNotNull, without checking that the resulting ItemStack/meta actually reflects the skull owner, spawner entity type, potion effect, or banner pattern their names claim to verify. They'd still pass if that branch were accidentally short-circuited. Consider strengthening these to cast getItemMeta() to the specific meta type and assert the applied value, similar to how fromSection_appliesItemFlags_whenItemFlagsProvided checks stack.getItemFlags().
  • LocalizationManagerTest.java:793,877,955,976,985 — The PR adds five new // --- Section --- comment dividers to group the new test blocks. CLAUDE.md's Anti-Patterns section explicitly disallows decorative section dividers (// --- Section --- or similar) in favor of relying on method names/@DisplayName. The file already had this pattern pre-PR, but these are newly-added instances of a documented anti-pattern.
  • @DisplayName phrasing (all three files, new tests) — New tests use "Given X, when Y, then Z" @DisplayName values, but CLAUDE.md's Test Naming Convention specifies @DisplayName should be a short descriptive label, not a Given/When/Then sentence (that phrasing belongs in the method name). This matches the pre-existing convention already used throughout these files, so it's not a new regression — flagging only as a note for a possible future cleanup pass, not something to fix in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants