-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make String to Boolean parameter conversion more strict #3178
Conversation
Cause use of anything other than 'true' or 'false' (case-insensitive) fail in conversion, to make potential typos explicitly visible (instead of implicitly just treating all else as 'false') Includes a few tests for failures on invalid values, for conversions handled by StringToBooleanAndCharPrimitiveConverter. Issue: #3177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting the PR so quickly!
I requested a few minor changes.
...upiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java
Show resolved
Hide resolved
...r-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java
Outdated
Show resolved
Hide resolved
...r-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java
Show resolved
Hide resolved
Sure thing, likewise thanks for the quick review :) Requested changes pushed accordingly. |
...upiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java
Outdated
Show resolved
Hide resolved
...r-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal looks good to me from a technical standpoint.
All that's missing is an entry in the release notes and, potentially, a note in the user guide.
Though I think we should hold off on those last two tasks until the rest of the team has voiced their approval.
Team Decision: Make it more strict by default since it's a more sane behavior. |
@s-rwe Could you please add an entry to the release notes and update the table in the User Guide? |
Ok sure thanks, done accordingly. |
documentation/src/docs/asciidoc/release-notes/release-notes-5.10.0-M1.adoc
Outdated
Show resolved
Hide resolved
I'll take it from here. |
@s-rwe Thank you for you contribution! 🙇♂️ |
Cause use of anything other than 'true' or 'false' (case-insensitive) fail in conversion, to make potential typos explicitly visible (instead of implicitly just treating all else as 'false')
Includes a few tests for failures on invalid values, for conversions handled by
StringToBooleanAndCharPrimitiveConverter
.Issue: #3177
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations