The data-driven tests are useful whenever the same test should be executed with different data.
In testing this is a common task and therefore has to be migrated to JUnit Jupiter.
As JUnit Team writes here the Jupiter equivalent is @ParameterizedTest in combination with a @MethodSource annotation.
DataProvider documentation from TestNG
Marks a method as supplying data for a test method. The annotated method must return an Object[][] where each Object[] can be assigned the parameter list of the test method. The Test method that wants to receive data from this DataProvider needs to use a dataProvider name equals to the name of this annotation.
In JUnit Jupiter data-driven are done with Parameterized tests with parameter sources.
A similar approach as in TestNG is possible with a Method Source which can also be in external classes.
The data-driven tests are useful whenever the same test should be executed with different data. In testing this is a common task and therefore has to be migrated to JUnit Jupiter. As JUnit Team writes here the Jupiter equivalent is
@ParameterizedTest
in combination with a@MethodSource
annotation.DataProvider documentation from TestNG
Marks a method as supplying data for a test method. The annotated method must return an Object[][] where each Object[] can be assigned the parameter list of the test method. The Test method that wants to receive data from this DataProvider needs to use a dataProvider name equals to the name of this annotation.
https://testng.org/#_annotations
Example
In OpenJDK there are exmaples of data-driven with TestNG, one is:
JUnit Jupiter Parameterized tests
In JUnit Jupiter data-driven are done with Parameterized tests with parameter sources. A similar approach as in TestNG is possible with a Method Source which can also be in external classes.
https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests
Example
The TestNG data-driven test from OpenJDK could be migrated from
into