-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Change @TestConstructor.autowire attribute into an enum #23224
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
Comments
Whoops, I raised this in the wrong repo. Transferred to |
Thanks for raising the issue, @philwebb. I agree that having an enum would allow for greater flexibility in the future. So, with that in mind, I'll likely make the change before 5.2 is released. Regarding the proposed enum constants, allow me to make that a little bit more concrete.
Is that what you had in mind, and what are the intended semantics for I'm guessing you mean all remaining parameters that have not been claimed to be supported by other registered parameter resolvers.
Regarding that point, I agree that that would be nice. Unfortunately, there is currently no way to achieve that with the available extension APIs in JUnit Jupiter. Though, perhaps a future release of JUnit Jupiter will provide such support, in which case an enum would allow us to support that autowire mode as well. Speaking of that, would you like to open an issue in the JUnit 5 GitHub repository requesting functionality along those lines? (if not, I can do that for you) |
Exactly. I just wanted to add it so we could consider the name in the context of the others.
I've raised junit-team/junit5#1945 |
@sbrannen LGTM 👍 |
I think it's possible that we might want to support different autowire modes with
@TestConstructor
in the future. Specifically, I think it would be nice if we could mix autowire with other extension mechanisms and have autowiring apply only when no otherParameterResolvers
match.I wonder if we should change
autowire
from aboolean
to anenum
so we can add more options in the future.e.g.:
The text was updated successfully, but these errors were encountered: