Skip to content

Add unit tests for LoadExternalPropertiesListener#2

Open
pineappleBest123 wants to merge 1 commit intoweb-servers:masterfrom
pineappleBest123:add-unit-tests
Open

Add unit tests for LoadExternalPropertiesListener#2
pineappleBest123 wants to merge 1 commit intoweb-servers:masterfrom
pineappleBest123:add-unit-tests

Conversation

@pineappleBest123
Copy link
Copy Markdown

Summary

  • Add JUnit 5 dependency and maven-surefire-plugin 3.2.5 to pom.xml
  • Add 25 unit tests covering all public methods of LoadExternalPropertiesListener:
    • setProperty(): prefix validation, case sensitivity, 99-file limit
    • loadPropertyFile(): null/empty/missing file handling, overwrite flag behaviour
    • loadProperties(): skip-if-loaded guard, case-insensitive key ordering, empty path skipping
    • loadProperties(Boolean force): force reload and no-op paths
    • lifecycleEvent(): only BEFORE_INIT_EVENT triggers load, idempotency
    • endSetPropertiesRule(): loadFirst flag behaviour

Test plan

  • mvn test passes with 25 tests, 0 failures

  - Add JUnit 5 dependency and maven-surefire-plugin 3.2.5 to pom.xml
  - 25 tests covering setProperty(), loadPropertyFile(), loadProperties(),
    loadProperties(Boolean), lifecycleEvent(), and endSetPropertiesRule()
  - Uses @tempdir for real .properties files and @AfterEach cleanup
    to avoid system property pollution between tests
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