Skip to content

[Unit Tests] Exception classes, player entity events, and PendingReward coverage#245

Open
DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/brave-goldberg-u32bsl
Open

[Unit Tests] Exception classes, player entity events, and PendingReward coverage#245
DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/brave-goldberg-u32bsl

Conversation

@DiamondDagger590

Copy link
Copy Markdown
Owner

Summary

  • ExceptionCoverageTest (37 tests): Covers all 15 exception classes across 8 packages — AbilityActivatedWithWrongEventException, AbilityNotRegisteredException, EventNotRegisteredForActivationException, AbilityDatabaseNameException, SkillHolderMissingSkillException, ContentPackFailedProcessingException, InvalidAbilityForLoadoutException, LoadoutMaxSizeExceededException, SelectedLoadoutAboveMaxException, LocaleParseException, NoLocalizationContainsMessageException, QuestScopeInvalidStateException, EventNotRegisteredForLevelingException, SkillNotRegisteredException, WorldGuardFlagRegisterException. Tests constructor storage, getters, getMessage() formatting, custom message overloads, and defensive copy behavior.
  • PlayerEntityEventCoverageTest (23 tests): Covers PlayerAwardedRestedExperienceEvent and PlayerSafeZoneStateChangeEvent. Tests constructor clamping (negative values to zero), setter clamping (between 0 and maxAccumulation), asymmetric constructor behavior (constructor does not clamp to max, only setter does), Cancellable contract (default false, settable, revertible), SafeZoneStateChangeType enum values, and handler list access.
  • PendingRewardCoverageTest (13 tests): Covers PendingReward data class. Tests all 7 getters, serialized config immutability (Map.copyOf), defensive copy from original mutable map, empty config support, and timestamp edge cases (zero, negative).

Packages covered (previously at 0% or low coverage)

Package Classes Tested Tests Added
exception.ability 3 7
exception.database 1 2
exception.entity 1 3
exception.expansion 1 2
exception.loadout 3 7
exception.localization 2 6
exception.quest 1 2
exception.skill 2 5
exception.external.worldguard 1 3
event.entity.player 2 23
quest.reward (PendingReward) 1 13

Total: 73 new test cases across 3 test files (project total: 2,370 tests, 0 failures)

Test plan

  • All 2,370 tests pass via ./gradlew verifiedShadowJar
  • Zero regressions across the full test suite
  • Tests follow CLAUDE.md naming conventions (@Test before @DisplayName, short descriptive labels, action_outcome_whenCondition method names, @Nested grouping)
  • Testing audit persona run against all changes — fixed unused imports, added assertNotSame for defensive copy verification, added asymmetric constructor clamping test
  • @ParameterizedTest with @EnumSource used for SafeZoneStateChangeType enum coverage
  • McRPGPlayerExtension used correctly for player-dependent event tests

https://claude.ai/code/session_011ZJuVXW6VsLAv8SK83vgEh


Generated by Claude Code

…rd coverage

Add 73 tests across 3 new test files:

- ExceptionCoverageTest (37 tests): All 15 exception classes across 8 packages
  (ability, database, entity, expansion, loadout, localization, quest, skill,
  worldguard). Tests constructor storage, getters, getMessage() formatting,
  custom message constructors, and defensive copy behavior.

- PlayerEntityEventCoverageTest (23 tests): PlayerAwardedRestedExperienceEvent
  and PlayerSafeZoneStateChangeEvent. Tests constructor clamping (negative values
  to zero), setter clamping (between 0 and maxAccumulation), asymmetric
  constructor behavior (no max clamp at construction), Cancellable contract,
  SafeZoneStateChangeType enum, and handler list access.

- PendingRewardCoverageTest (13 tests): PendingReward data class. Tests all
  getters, serialized config immutability (Map.copyOf), defensive copy from
  original mutable map, empty config support, and timestamp edge cases.

https://claude.ai/code/session_011ZJuVXW6VsLAv8SK83vgEh
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

More reviews will be available in 52 minutes and 14 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9c4ae6ce-d7d7-4be5-acf3-3c13292fac3c

📥 Commits

Reviewing files that changed from the base of the PR and between 9b47c9a and 66271c1.

📒 Files selected for processing (3)
  • src/test/java/us/eunoians/mcrpg/event/entity/player/PlayerEntityEventCoverageTest.java
  • src/test/java/us/eunoians/mcrpg/exception/ExceptionCoverageTest.java
  • src/test/java/us/eunoians/mcrpg/quest/reward/PendingRewardCoverageTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/brave-goldberg-u32bsl

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 and usage tips.

@github-actions

Copy link
Copy Markdown

Extensibility Review

Breaking change risk: NONE — This diff adds only test classes; no production API surface is modified.

After reviewing the diff in full, all three new files are test-only additions located under src/test/java/. No public interfaces, abstract classes, event classes, registry entries, NamespacedKey constants, getDatabaseName() implementations, or any other production API surface is touched.

No extensibility concerns found.

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