I'm looking for how to pass a parameter into a metod that use the @MethodSource annotatio in Junit5
For example I need to invoke @MethodSource annotation and passing a value into the method "MyFactoryMethod". It is possible? Sometings like this:
@ParameterizedTest
@MethodSource("MyFactoryMethod(10)")
void testWithMethodSource(int argument) {
assertNotEquals(9, argument);
}
static IntStream MyFactoryMethod(String var) {
return IntStream.range(0, var);
}
Thanks in advance