Ha! That's a very good question that I just recently asked Sam Brannon, one of the core committers of JUnit 5. :)
His answer goes as follows:
There are other "things" that support @DisplayName like test class (as shown in my example), @TestFactory, @RepeatedTest, @ParameterizedTest and @TestTemplate. Having @DisplayName orthogonal to those features is just about separating concern.
If JUnit would have a concept like @AliasFor meta annotations in spring, ´this would still be possible (but it doesn't)
You could write your own custom composed annotation
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ha! That's a very good question that I just recently asked Sam Brannon, one of the core committers of JUnit 5. :)
His answer goes as follows:
@DisplayName
like test class (as shown in my example),@TestFactory
,@RepeatedTest
,@ParameterizedTest
and@TestTemplate
. Having@DisplayName
orthogonal to those features is just about separating concern.@AliasFor
meta annotations in spring, ´this would still be possible (but it doesn't)