In JUnit 4 tests could be run as Parameterized. These test class had to define a method annotated with @Parameters. This method would return a set of parameters and the tests in the test class would be executed for every tuple of parameters. Do we have the same concept in JUnit 5?
I understand that with the Extensions API I can either define a TestPostProcessor or a ParameterResolver. But none of these will allow me do run the same test cases for different parameters, do they?
Should I rather use a @TestFactory for this purpose?
You are correct in your analysis: @TestFactory is the tool to use for this use case.
@schauder is correct: for the time being, @TestFactory is your only choice.
However, JUnit Jupiter will eventually support some form of parameterized tests. See #14, #371, and #276.
Closing this issue as a _duplicate_.
I had a look into TestFactory and it doesn't really work for me. The drawbacks of DynamicTests (e.g. there's no integration with @BeforeEach ) and the need for parameterized tests have already been discussed in other issue tickets (I wasn't aware of these when opening this issue), so I'll stay tuned for updates there.
Rest assured, we're working on it! We plan to address this in the next milestone release.