-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat overloaded local & external @MethodSource factory methods equally
Prior to this commit, given overloaded @MethodSource factory methods, a local qualified method name (LQMN) was not treated the same as a fully-qualified method name (FQMN). Specifically, if the user provided a FQMN without specifying the parameter list, JUnit Jupiter would find the factory method that accepts zero arguments. Whereas, if the user provided an LQMN without specifying the parameter list, JUnit Jupiter would fail to find the factory method. This commit fixes that bug by reworking the internals of MethodArgumentsProvider so that overloaded local and external factory methods are looked up with the same semantics. The commit also improves diagnostics for failure to find a factory method specified via LQMN by falling back to the same lenient search semantics that are used to locate a "default" local factory method. Furthermore, this commit modifies the internals of MethodArgumentsProvider so that it consistently throws PreconditionViolationExceptions for user configuration errors. This commit also introduces additional tests for error use cases. See: #3130, #3131 Closes: #3266
- Loading branch information
Showing
4 changed files
with
300 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.