-
-
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
Add null value attribute to @CsvSource and @CsvFileSource #1883
Add null value attribute to @CsvSource and @CsvFileSource #1883
Conversation
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.
Looks good overall, left some comments in-line.
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java
Outdated
Show resolved
Hide resolved
Hello Maintainers, I am a first time commiter in this project and not sure about the "Definition of Done". Also this is a PreView PR because I wanted to make sure the change is cool for you. |
Please run 'gradlew spotlessApply' to fix source code format violations automatically. |
@sormuras i fixed the formatting issue. I also have a questions about the "Definition of Done". |
Thanks for the PR! 👍
They are an indicator how for a PR is. Check them when you think a task is done. We'll go over them and double-check anyway. |
I like how you solved the problem with the processor and looks good to me. Thank you for the PR! |
As an improvement, in case of having nullSymbols = {}, there is no need to create a processor and there is no need to process the pasedLine in both CSV Argument Providers. |
...jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java
Show resolved
Hide resolved
@Ciruman, this PR now contains a lot of noise. Can you please rebase your work on |
@sbrannen, I did not create the PR. The PR was created by @Farbauti89 . @Farbauti89, can you update the PR? |
Indeed. Sorry about mixing up the user names. |
5153928
to
4d0a858
Compare
Hi @sbrannen,
I did, as you commanded - at least I hope so :) |
4d0a858
to
9ce5399
Compare
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 squashing and rebasing on master
!
I've added a few additional requests for the time being.
documentation/src/docs/asciidoc/release-notes/release-notes-5.6.0-M1.adoc
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java
Show resolved
Hide resolved
Tentatively slated for 5.6 M1 |
454ea24
to
1101f70
Compare
Thanks for making the requested changes. In general, I think the PR looks pretty good, but I have not performed an in-depth technical review of the implementation yet. |
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.
@Farbauti89 Please rebase your PR once more -- I'll review it finally shortly after that.
1101f70
to
16c2cb1
Compare
The new `nullSymbols` Attribute can be used in the @CsvSource- and @CsvFile-Annotation to describe values that should be interpreted as `null` Issue: junit-team#1856
16c2cb1
to
f7b8fdc
Compare
@sormuras I just rebased the PR. |
Thanks. Reviewing today. |
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.
LGTM. We'll take it from here.
Merged. Thanks again, @Farbauti89 🎉 |
No worries. We, as software engineers, often do our best to avoid reinventing the wheel (which is a good thing). So if a library already has a feature we need, it's tempting to just use it. In this case, none of us realized there was a simpler (and more efficient) solution while reviewing the PR in the browser. I only noticed it while reviewing the changes in my IDE after the PR had been merged into
You're welcome. And... I also learned a lot more about the internals of Univocity in the process. So we all learned something. 😉 |
Overview
This PR implements the proposed enhancement in #1856 .
It will introduce a
nullSymbols
attribute in theCsvSource
andCsvFileSource
Annotation.The
nullSymbols
will be converted intonull
if it is found in the CSV.Resolves #1856
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations