Skip to content

[Unit Tests] Add coverage for woodcutting abilities and quest chain events - #330

Open
DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/magical-cray-i8ocbm
Open

[Unit Tests] Add coverage for woodcutting abilities and quest chain events#330
DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/magical-cray-i8ocbm

Conversation

@DiamondDagger590

@DiamondDagger590 DiamondDagger590 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add unit tests for HeavySwing and DryadsGift woodcutting abilities (activation chance, radius/XP drop with Parser formula evaluation, block validation, metadata accessors)
  • Add unit tests for three previously-untested quest chain events: QuestChainExpireEvent, QuestChainRestartEvent, QuestChainStepRetryEvent
  • Tests cover online/offline player paths, cancellable behavior, parameterized enum variants, handler list access, and tier-specific vs all-tiers config fallback

New test files (5)

File Tests What's covered
HeavySwingTest 14 getActivationChance, getRadius, isBlockValid, metadata
DryadsGiftTest 14 getActivationChance, getExperienceToDrop, isBlockValid, metadata
QuestChainExpireEventTest 6 Getters, offline Optional, cancel toggle, handler list
QuestChainRestartEventTest 4 Getters, offline null, parameterized RestartReason, handler list
QuestChainStepRetryEventTest 4 Getters, offline null, unlimited retries, handler list

Test plan

  • All 5 new test files compile and pass
  • Full test suite passes (./gradlew test — zero failures)
  • Testing audit persona reviewed changes (one nit fixed: fully-qualified UUID reference)

Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage for woodcutting ability activation, experience calculations, tier overrides, formulas, valid blocks, and metadata.
    • Added coverage for quest chain expiration, restarting, and step retry events.
    • Verified event cancellation, handler access, player resolution, restart reasons, and unlimited retries.

Cover HeavySwing and DryadsGift (activation chance, radius/XP drop,
block validation, metadata accessors) and three quest chain events
(QuestChainExpireEvent, QuestChainRestartEvent, QuestChainStepRetryEvent).

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

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @DiamondDagger590's task in 3m 23s —— View job


Claude is reviewing this PR

Todo list

  • Read .github/claude-review-prompt.md and follow the orchestrated review protocol
  • Analyze the 5 new test files against the diff (origin/recode...HEAD) and the production code they cover
  • Manually verify all Parser formula assertions (activation chance / radius / experience-to-drop math) are correct
  • Manually verify test conventions against sibling files (BleedTest, QuestChainStartEventTest, etc.)
  • Run review-testing lens (only applicable lens — no production code changed) for a second pass
  • Consolidate findings and post final review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: fd8cd4c1-f44b-4264-9252-432fb0f388ce

📥 Commits

Reviewing files that changed from the base of the PR and between cc181c0 and 81c271a.

📒 Files selected for processing (5)
  • src/test/java/us/eunoians/mcrpg/ability/impl/woodcutting/DryadsGiftTest.java
  • src/test/java/us/eunoians/mcrpg/ability/impl/woodcutting/HeavySwingTest.java
  • src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainExpireEventTest.java
  • src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainRestartEventTest.java
  • src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainStepRetryEventTest.java

📝 Walkthrough

Walkthrough

This PR adds new unit tests for two woodcutting abilities and three quest-chain event classes. The tests cover configuration-driven values, fallback and formula behavior, block validation, metadata accessors, event getters, cancellation state, retry values, restart reasons, and handler-list access.

Changes

Test coverage additions

Layer / File(s) Summary
Woodcutting ability behavior tests
src/test/java/us/eunoians/mcrpg/ability/impl/woodcutting/DryadsGiftTest.java, src/test/java/us/eunoians/mcrpg/ability/impl/woodcutting/HeavySwingTest.java
Adds test fixtures and assertions for DryadsGift and HeavySwing. The tests cover tier-specific and all-tier configuration lookup, formula and literal parsing, experience and radius truncation, valid block detection, and ability metadata and YAML accessors.
Quest-chain event contract tests
src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainExpireEventTest.java, src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainRestartEventTest.java, src/test/java/us/eunoians/mcrpg/event/quest/chain/QuestChainStepRetryEventTest.java
Adds event tests for constructor state, online and offline player handling, cancellation state changes, restart-reason coverage, unlimited retry values, and HandlerList access for the three quest-chain event classes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the pull request's main changes: unit tests for woodcutting abilities and quest chain events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/magical-cray-i8ocbm

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.

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