-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
The ParameterizedTest name states the supported placeholder "{0}, {1}, etc.: an individual argument (0-based)" may be formatted with a MessageFormat pattern, "For the latter, you may use java.text.MessageFormat patterns to customize formatting." However, the argument passed to the pattern are not the arguments the method excepts but the argument supplied by the argument provider.
This can be seen in this silly test:
@ParameterizedTest(name = "{0,number,#.00}")
@ValueSource(ints = { 10, 20 })
@CsvSource(value = { "30", "40" })
void silly(double value)
{
// ValueSource - OK
// CsvSource - FAILS with Exception
}It seems that the format is called before any conversation, whether implicit or explicit.
Not sure if this is a bug as such but the documentation should specify what argument is formated.