Community
Participate
Working Groups
Add a quick assist to combine selected annotations into a composed annotation. For example, see: https://stackoverflow.com/questions/57629096/how-to-reuse-junit-jupiter-methodsource-for-multiple-parameterized-tests/57629806?stw=2#57629806 @ParameterizedTest @MethodSource("example.Testing#text()") void A(String text) { System.out.println(text); } If the user selects the following in the above example: @ParameterizedTest @MethodSource("example.Testing#text()") there can be a quick assist to combine them into a composed annotation type: @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @ParameterizedTest @MethodSource("example.Testing#text()") public @interface ParameterizedTextTest { } We need to check the configuration of the selected annotation types. We can also open the "New Annotation Type" dialog with the quick assist if it is required for configuration from the user.
Thanks for creating the ticket! > We need to check the configuration of the selected annotation types. Agreed. The @Retention should probably default to RetentionPolicy.RUNTIME. And the @Target should likely be created by a "plausible" combination of the targets for the meta-annotations. For example, if none of the meta-annotations has a target of TYPE, then the new composed annotation also should not have a target of TYPE. > We can also open the "New Annotation Type" dialog with the quick assist if it is required for configuration from the user. That also sounds viable. For the new composed annotation, it would also be nice if @Documented and @Inherited are taken into consideration.