[Unit Tests] Exception classes, player entity events, and PendingReward coverage#245
[Unit Tests] Exception classes, player entity events, and PendingReward coverage#245DiamondDagger590 wants to merge 1 commit into
Conversation
…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
|
Warning Review limit reached
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 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 (3)
✨ 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 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 No extensibility concerns found. |
Summary
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.PlayerAwardedRestedExperienceEventandPlayerSafeZoneStateChangeEvent. 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),Cancellablecontract (default false, settable, revertible),SafeZoneStateChangeTypeenum values, and handler list access.PendingRewarddata 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)
exception.abilityexception.databaseexception.entityexception.expansionexception.loadoutexception.localizationexception.questexception.skillexception.external.worldguardevent.entity.playerquest.reward(PendingReward)Total: 73 new test cases across 3 test files (project total: 2,370 tests, 0 failures)
Test plan
./gradlew verifiedShadowJar@Testbefore@DisplayName, short descriptive labels,action_outcome_whenConditionmethod names,@Nestedgrouping)assertNotSamefor defensive copy verification, added asymmetric constructor clamping test@ParameterizedTestwith@EnumSourceused forSafeZoneStateChangeTypeenum coverageMcRPGPlayerExtensionused correctly for player-dependent event testshttps://claude.ai/code/session_011ZJuVXW6VsLAv8SK83vgEh
Generated by Claude Code