first draft for custom element resolver (#518) #566
Closed
+127
−77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
To be able to provide a custom
ElementResolver
(#518), I tried some things and like this one quite well at the moment.Details
It fits quite nice (IMHO) into the existing code / API by resolving the
ExtensionRegistry
earlier within the affected test descriptions (problem of mutability should be solved, though). This could also be more generalized by moving the new property up toJupiterTestDescription
and add the current default element resolvers fromDiscoverySelectorResolver
to default extensions.Disclaimer
The junit-dataprovider tests would already run using some quick and dirty implementation, see https://github.com/TNG/junit-dataprovider/compare/issue75-custom-junit5-element-resolver?expand=1
Also the test fixes are a bit hacky at the moment
Your opinion?
Does that go into the right direction? Or do you have something different in mind? What and why do you like / not like it (such that I can think of another solution)?
P.S.: This is just a first PoC / draft to discuss it more concrete ;-)
I hereby agree to the terms of the JUnit Contributor License Agreement.