Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeated @ExtendWith in Kotlin & JUnit 5

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 enter image description here

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?

like image 939
daharon Avatar asked Dec 17 '22 19:12

daharon


1 Answers

Repeatable annotations are not yet supported in Kotlin. You can, however, use the Extensions annotation:

@Extensions(
    ExtendWith(...),
    ExtendWith(...)
)
like image 103
Leonardo Lima Avatar answered Jan 06 '23 21:01

Leonardo Lima