I'm trying to perform a parametrized JUnit 5 test, how to accomplish the following?
@ParametrizedTest
@ValueSource //here it seems only one parameter is supported
public void myTest(String parameter, String expectedOutput)
I know I could use @MethodSource but I was wondering if in my case I just need to understand better @ValueSource.
The documentation says:
@ValueSource is one of the simplest possible sources. It lets you specify a single array of literal values and can only be used for providing a single argument per parameterized test invocation.
Indeed you need to use @MethodSource for multiple arguments, or implement the ArgumentsProvider interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With