-
-
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
Support @EnumSource
, @CsvSource
, etc. as repeatable annotations
#3736
Comments
@EnumSource
as a repeatable annotation
Team decision: Make all |
The functionality required to support this feature is luckily already available. |
@EnumSource
as a repeatable annotation@EnumSource
, @CsvSource
, etc. as repeatable annotations
@sbrannen I would like to grab this one if it's still valid |
Hi @madalingiurca, This issue is labeled as So feel free to submit a PR! |
@madalingiurca Have you already started on this? |
@marcphilipp nothing apart from forking the junit5 repo, unfortunately. I'll try to find some time for it by the end of this week. If anyone else is planning to submit a PR faster, feel free to do it |
No worries! Please let us know when you start. |
@marcphilipp, I've drafted one approach in #3787. So far, I've adapted |
Thanks! I added a few comments and suggestions. 👍 |
@marcphilipp, I've wrapped up the changes and updated release notes + user guide (although not sure if former is needed). Let me know if anything else should be updated. |
This commit makes every `@..Source` annotations that makes use of `AnnotationBasedArgumentsProvider` repeatable by adapting to accept multiple annotations while aggregating the result of each annotation argument. This change does not affect annotations related to null and/or empty sources: `@NullSource`, `@EmptySource` and `@NullAndEmptySource` since they have predefined/hardcoded arguments relevant to null and empty values. Resolves #3736.
Given following example with types from the JDK,
the compiler complains with:
It would be useful if multiple
@EnumSource
annotations were allowed for a single parameterized test.My use case would be two enums that both implement the same interface that is used as the method parameter.
(Others JDK types are
java.nio.file.LinkOption
andjava.nio.file.StandardOpenOption
that implement the samejava.nio.file.OpenOption
.)The text was updated successfully, but these errors were encountered: