Add the ability to provide additional extensions when using @SpringJunitConfig
The convenience annotation is nice but can't be used when there's more than 1 extension. A common example of this would be utilizing LocalStack:
@ExtendWith({SpringExtension.class, LocalstackDockerExtension.class})
Note that multiple @ExtendWith annotations are supported but supporting multiple within @SpringJunitConfig would be a nice addition/convenience to reduce the amount of annotations ... especially since tests often have several on the class already.
Comment From: sbrannen
This is unfortunately not possible.
@SpringJUnitConfig is an annotation provided by the Spring Framework; whereas, @ExtendWith is an annotation provided by JUnit Jupiter.
Although the Spring Framework has support for custom composed annotations via the @AliasFor annotation, JUnit does not have such support.
Thus, although we could technically introduce an attribute in @SpringJUnitConfig that would allow one to declare additional JUnit Jupiter extensions, JUnit Jupiter would never be able to find those declarations within the Spring annotation.
However, if you find that you are repeatedly declaring @SpringJUnitConfig alongside @ExtendWith(LocalstackDockerExtension.class) in your own projects, you could of course introduce your own composed version of @SpringJUnitConfig that is meta-annotated with @ExtendWith({SpringExtension.class, LocalstackDockerExtension.class}).