I'm using JUnit 5.7.0, IntellijIDEA 2021.1.2 CE, MacOS Catalina 10.15. and don't understand the difference between
ParameterizedTest.ARGUMENTS_PLACEHOLDER
and ParameterizedTest.ARGUMENTS_WITH_NAMES_PLACEHOLDER
.
According to the javadoc ARGUMENTS_WITH_NAMES_PLACEHOLDER
deals with named arguments whereas ARGUMENTS_PLACEHOLDER
with just arguments.
The test result in IDEA for both tests looks the same:
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
@ParameterizedTest(name = ARGUMENTS_WITH_NAMES_PLACEHOLDER)
@CsvSource({"apple, 1", "banana, 2", "'lemon, lime', 3" })
void testWithArguments(String fruit, int rank) {
}
@ParameterizedTest(name = ARGUMENTS_PLACEHOLDER)
@CsvSource({"apple, 1", "banana, 2", "'lemon, lime', 3" })
void testWithNamedArguments(String fruit, int rank) {
}
Can anyone provide an example where these two placeholders behave differently?