Skip to content

🧪 Add unit tests for Config.validateItemName#13

Open
sayore wants to merge 1 commit into
mainfrom
add-config-tests-8674121778492828806
Open

🧪 Add unit tests for Config.validateItemName#13
sayore wants to merge 1 commit into
mainfrom
add-config-tests-8674121778492828806

Conversation

@sayore

@sayore sayore commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

🎯 What: The testing gap addressed
The validateItemName method inside Config lacked any test coverage, making it unclear how the config handles invalid strings, unsupported objects, or malformed formats.

📊 Coverage: What scenarios are now tested

  • Non-String types (Integer, Object, null values).
  • Invalid ResourceLocation string formats (which safely throw expected exceptions).
  • Valid Minecraft ResourceLocation formats (ensuring true outcomes for valid strings and false outcomes for unregistered items).

Result: The improvement in test coverage
The method is now fully covered with functional tests that boot up Minecraft registries and successfully evaluate actual conditions within the mod configuration logic.


PR created automatically by Jules for task 8674121778492828806 started by @sayore

This commit introduces comprehensive unit testing for the `validateItemName` method.
The method was modified to package-private to allow access from testing classes within the same package.
A test class `ConfigTest.java` was created to test positive and negative inputs as well as varying formats.

The testing dependencies (JUnit Jupiter) were also set up in `build.gradle` along with updates to test classpaths.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant