Add test setup#8
Merged
Merged
Conversation
PimvanderLoos
added a commit
that referenced
this pull request
May 14, 2026
This commit resolves the actionable findings from the automated reviews. It is the first fix-up pass in the review loop; a follow-up commit will upgrade Jackson to v3 to address the CVE finding. Protocol fixes: - Add CommandSource enum to lightkeeper-protocol; wire into ExecuteCommand.Command (replaces raw String commandSource) and move from lightkeeper-framework-junit so the type is co-located with the command that uses it (#14) - Add compact constructors to CreatePlayer.Command to reject blank name/worldName at construction time (#1) - Add compact constructor to DragMenuSlots.Command to clone int[] slots, preventing external mutation of the record (#11) - Add compact constructor to WaitTicks.Command to reject ticks < 0 at construction time; remove now-redundant handler-level check (#16) - Update DropItem class Javadoc to reflect actual drop semantics (#7) Agent handler fixes: - handleExecuteCommand: rename parameter to req to eliminate the cmd/command naming clash; switch on CommandSource enum (#9, #14) - handleExecutePlayerCommand: same parameter rename (#9) - handleDropItem: actually drop the item when event is not cancelled — entity stays in world and one item is consumed from main hand; entity is removed only when the event is cancelled (#7) Test coverage: - AgentRequestDispatcherTest: add dispatch cases for all 12 new protocol commands that were missing (TeleportPlayer, LoadChunk, UnloadChunk, IsChunkLoaded, GetPlayerInventory, DropItem, Register/Get/Clear/UnregisterEventListener, GetPlayerChatComponents, GetServerPlatform) (#18) - AgentPlayerActionsTest: add two handleDropItem tests covering the not-cancelled (entity kept, inventory consumed) and cancelled (entity removed, inventory unchanged) paths (#7, #8) - AgentWorldActionsTest: update WaitTicks negative-ticks test to assert on construction-time IllegalArgumentException (#16) - UdsAgentClientTest: add 9 new tests covering mainWorld, getServerTick, isChunkLoaded, dropItem (both paths), getPlayerInventory, getCapturedEvents, serverPlatform, executeCommand action field; extend AgentSocketServer helper to capture the request line (#8) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.