-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Bug
Copy link
Description
Overview
When I introduced support for declarative extension registration on fields and parameters in JUnit Jupiter 5.8, I neglected to sync the @Target
declaration for @Extensions
with the new supported targets for @ExtendWith
.
Consequently, it is possible to declare a single @ExtendWith
annotation on a field or parameter, but it is not currently possible to declare multiple @ExtendWith
annotations directly on a field or parameter.
For example, the following currently fails to compile.
@ExtendWith(RandomNumberExtension.class)
@ExtendWith(NumberParameterResolver.class)
private int magicNumber;
Similarly, the following also fails to compile.
@BeforeEach
void prepareTestData(
@ExtendWith(RandomNumberExtension.class)
@ExtendWith(NumberParameterResolver.class)
int magicNumber
) {
// method body...
}
Related Issues
Deliverables
- Ensure
@ExtendWith
can be used as a repeatable annotation directly on fields and parameters - Remove exclusion in
ArchUnitTests
- Backport to 5.11.x branch