@MethodSource and @CsvSource
Learn how to use the @MethodSource and @CsvSource arguments in JUnit 5.
We'll cover the following...
@MethodSource
The org.junit.jupiter.params.provider.MethodSource
annotation uses one or more methods in the test class to provide the arguments. The methods must have no arguments and return a Stream
, Iterable
, Iterator
, or array of arguments. The methods must be static unless they use an instance life cycle.
In the code below, we use simpleMethod()
...