Fix broken Ponder build dependency and add PlayerRecord/ExperienceCalculator unit tests - #145
Merged
dmccoystephenson merged 2 commits intoAug 2, 2026
Conversation
Characterizes the currently-untested skill-level/experience bookkeeping logic (level/exp getters-setters, overall level aggregation, level-up threshold checks, save/load round-trip) using Mockito, and locks in ExperienceCalculator's requirement formula. Bukkit-static-dependent branches (auto-learning an unknown skill, leveling up) are left uncovered since mockito-core (no mockito-inline) can't stub Bukkit.getPlayer(...). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The pinned tag v0.14-alpha-2 no longer exists in Dans-Plugins/Ponder,
and the declared groupId/artifactId ("preponderous"/"ponder") was
never resolvable via jitpack for this repo. This broke `mvn compile`
for everyone, including CI on main (confirmed failing since at least
the last merge to main).
Switches to com.github.Dans-Plugins:Ponder:v0.14 (jitpack's standard
GitHub-based coordinates), the nearest existing tag whose package
layout (preponderous.ponder.minecraft.{abs,nms,spigot.*}) exactly
matches this project's existing imports, so no source changes were
needed. Related to #116, but not a full fix: the actual latest tag
(v0.15-alpha-2) renames minecraft.spigot.* to minecraft.bukkit.*,
which is a breaking migration left for a follow-up.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric:
Repo-specific:
Note for the merge gate: this PR modifies This comment was drafted during a Gardener session (Stephenson-Software/gardener). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR does two coupled things — the second needed the first to actually verify in CI:
pom.xmlpinnedpreponderous:ponder:v0.14-alpha-2, which is broken two ways: that tag doesn't exist in Dans-Plugins/Ponder anymore, and thegroupId:artifactIdcasing (preponderous:ponder) was never resolvable via jitpack (Ponder's ownpom.xmldeclarespreponderous:Ponder, and jitpack in practice only serves it undercom.github.Dans-Plugins:Ponder). This has been breakingmvn compile/CI onmainfor everyone (confirmed: the last CI run onmainfailed with the same error, and none of the other 8 open PRs in this repo have any CI checks reported at all). Switches tocom.github.Dans-Plugins:Ponder:v0.14— the nearest existing tag whose package layout matches this project's existing imports exactly, so no source changes were needed. Related to Update Ponder dependency to latest release #116 but does not close it — see the comment I left there on why a true "latest release" upgrade is a separate, larger, breaking migration.src/testtests, despite JUnit 4 + Mockito already being wired intopom.xmlwith nothing using them:PlayerRecordTest: skill-level get/set, experience get/set,getKnownSkills/isKnown,getOverallSkillLevel(filters inactive/removed skills),incrementExperience's no-level-up and max-level-skip branches,checkForLevelUpbelow-threshold behavior, and asave()/load()round-trip.ExperienceCalculatorTest: thegetExperienceRequiredForLevelUpformula (level 0, level 1, zero factor, general scaling, int-truncation).Known gap, left uncovered on purpose:
PlayerRecord.learnSkill(...)/levelUp(...)callBukkit.getPlayer(...)(a static Bukkit accessor). The project pinsmockito-core:3.12.4with nomockito-inline, so stubbing that static call isn't available without adding a new test dependency — left out of scope here. Auto-learning an unknown skill and the leveling-up branch ofcheckForLevelUpremain covered only by the manual.testcontainerSpigot smoke harness.Test plan
mvn clean package(the exact command CI runs) — green locally after the dependency fix:BUILD SUCCESS, all 18 new tests pass.mvn test—Tests run: 18, Failures: 0, Errors: 0, Skipped: 0.v0.14andv0.15-alpha-2thatv0.14's package layout matches this project's imports exactly, whilev0.15-alpha-2renames packages (documented in the commit message and issue Update Ponder dependency to latest release #116 comment).Related: #116 (not closed — see above)
This PR description was drafted during a Gardener session (Stephenson-Software/gardener).