ParameterizedTest with @MethodSource
This lesson demonstrates use of @MethodSource to pass different arguments to @ParameterizedTest.
We'll cover the following...
@MethodSource
@MethodSource
allows us to specify a factory method for different test arguments. This factory method must be static
and can be present in the same class or any other class too.
The factory method should return Stream, Iterator, Iterable or array of elements to @ParameterizedTest
method.
Let’s look at a demo. ...