-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Document parameter resolution conflicts #3829
base: main
Are you sure you want to change the base?
Document parameter resolution conflicts #3829
Conversation
Please could I get some feedback for this PR? |
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.
Sorry for the delay! The new section does a good job at explaining why/when conflicts occur. However, it does not document the best practices mentioned in the issue description. For example, using a custom annotation and/or a custom parameter type. Could you please add that?
==== Parameter Conflicts | ||
|
||
If multiple implementations of `ParameterResolver` that support the same type are | ||
declared within a test class, a `ParameterResolutionException` will be thrown, with a |
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.
declared within a test class, a `ParameterResolutionException` will be thrown, with a | |
registered for a test, a `ParameterResolutionException` will be thrown, with a |
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.
Wording updated
|
||
If multiple implementations of `ParameterResolver` that support the same type are | ||
declared within a test class, a `ParameterResolutionException` will be thrown, with a | ||
message to indicate that competing types have been discovered. See the following example: |
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.
message to indicate that competing types have been discovered. See the following example: | |
message to indicate that competing resolvers have been discovered. See the following example: |
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.
Wording updated
@RegisterExtension | ||
final FirstIntegerResolver firstIntegerResolver = new FirstIntegerResolver(); |
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.
Using @ExtendWith
would be more idiomatic here and below because there's no state or configuration that would justify programmatic extension registration.
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.
Changed to @ExtendWith
here and also in the other code examples.
Issue: junit-team#1190
Thanks for the feedback! I've added examples of using a custom type and a custom annotation. |
Issue: #1190
Overview
User guide updated to explain
ParameterResolver
conflicts and provide some ways to resolve them.I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations