With JUnit 5, parameterized tests are really more straight and natural to use as with JUnit 4.
In your case, to provide multiple parameters as input, you could use the @CsvSource
annotation.
Here are the required dependencies (maven declaration way) :
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.0-M4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.0.0-M4</version>
<scope>test</scope>
</dependency>
And here is a sample code (with required imports) :
import org.junit.Assert;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
public class YourTestClass{
@ParameterizedTest
@CsvSource({ "12,3,4", "12,2,6" })
public void divideTest(int n, int d, int q) {
Assert.assertEquals(q, n / d);
}
}