Generating display names for @ParameterizedTest in JUnit 5
As of JUnit 5.8.0, there is a Named<T> interface as part of the JUnit Jupiter API with “automatic support for injecting the contained payload [the arguments] into parameterized methods directly” (see issue #2301). Example: @DisplayName(“A parameterized test with named arguments”) @ParameterizedTest @MethodSource(“namedArguments”) void testWithNamedArguments(File file) {} static Stream<Arguments> namedArguments() { return Stream.of( Arguments.of(Named.of(“An important file”, … Read more