Issue
I'm using JUnit 5 in a Kotlin project and observing behavior that does not match the documentation.
When using multiple @ExtendWith
annotations on a test class I receive the following error:
Repeatable annotations with non-SOURCE retention are not yet supported
In the Extension
section of the JUnit documentation this is listed as a valid option.
I'm using Kotlin 1.3.10 and JUnit 5.3.2
Why am I unable to repeat the @ExtendWith
annotation on my test classes?
Solution
Repeatable annotations are not yet supported in Kotlin. You can, however, use the Extensions annotation:
@Extensions(
ExtendWith(...),
ExtendWith(...)
)
Answered By - Leonardo Lima