Hiteshsai007 commented on PR #12418:
URL: https://github.com/apache/maven/pull/12418#issuecomment-4886496083
@elharo Thanks for the review!
I have addressed your feedback by adding comprehensive unit tests for the
configuration saving logic.
To accomplish this, I:
1. Refactored `Init.java` by extracting the prefix-prepending logic into a
testable, package-private static method (`applyTemplatePrefix`).
2. Added a new `InitTest.java` suite that covers all edge cases, including:
- **Missing prefixes**: prepending `env:` when the user only types
`MVN_PASSWORD`.
- **Duplicate prefixes**: preventing double-prefixing if the user
manually types `env:MVN_PASSWORD`.
- **Other prefix types**: ensuring it correctly handles `sys-property:`,
`file:`, etc.
- **Edge conditions**: properly handling empty user inputs, missing
templates, and templates without placeholders.
3. Verified the changes locally with a full `mvn clean verify` on the
`maven-cli` module to ensure all tests, Spotless formatting, and Checkstyle
rules pass successfully.
Let me know if there's anything else needed before we can merge this!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]