Skip to content

test: improve KnuddelsRuntimeHints test coverage#4529

Closed
alxkm wants to merge 1 commit intospring-projects:mainfrom
alxkm:test/knuddels-runtime-hints-coverage
Closed

test: improve KnuddelsRuntimeHints test coverage#4529
alxkm wants to merge 1 commit intospring-projects:mainfrom
alxkm:test/knuddels-runtime-hints-coverage

Conversation

@alxkm
Copy link
Contributor

@alxkm alxkm commented Oct 1, 2025

Description
This PR adds comprehensive test coverage for the KnuddelsRuntimeHints class to verify its behavior in registering runtime hints for native image compilation.
Changes
Added 5 new test methods to KnuddelsRuntimeHintsTest:

  • Custom ClassLoader: Tests hint registration works with a custom ClassLoader
  • No reflection hints: Verifies that only resource hints are registered, no reflection
  • No proxy hints: Ensures no proxy hints are unnecessarily added
  • Idempotent registration: Validates that multiple registrations handle correctly
  • Resource specificity: Confirms hints are specific to jtokkit tokenizer resources

Motivation
The existing test only verified one resource file registration. These additions ensure the runtime hints are correctly scoped (resources only, no reflection/proxy), work with different ClassLoaders, and handle multiple registrations properly. This is critical for optimal native image compilation.

Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
Signed-off-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Oct 3, 2025
@ilayaperumalg
Copy link
Member

@alxkm Thanks for adding the tests!

@ilayaperumalg
Copy link
Member

Rebased and merged as d0c9e86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants