-
-
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.
Support declarative extension registration on fields and parameters
Prior to this commit, @ExtendWith could only be used to register extensions declaratively on test interfaces, test classes, and test methods. However, there are certain use cases where it is more convenient for the user if extensions can be registered declaratively on fields and parameters. This commit introduces support for registering extensions declaratively via @ExtendWith on the following elements. - static fields - non-static fields - parameters in test class constructors, test methods, and lifecycle methods (i.e., @BeforeAll, @afterall, @beforeeach, and @AfterEach methods) Fields annotated or meta-annotated with @ExtendWith can have any visibility (including private) and can be sorted relative to @RegisterExtension fields via the @order annotation. See the RandomNumberExtension example in the User Guide. Closes #864, #2680
- Loading branch information
Showing
15 changed files
with
1,314 additions
and
172 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
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.