JUnit tests that use @Parameters
annotation must be run with
@RunWith(Parameterized.class)
However junitparams uses it's own runner
@RunWith(JUnitParamsRunner.class)
A JUnit test can only use a single runner so I don't see how they both can work together unless someone merges the two runners into one.
The easiest solution is to forego junitparams and implement the logic that reads data from the input file and turns it into a parameter list so you can return that from a method annotated with @Parameters
.
Another solution is to modify JUnitParamsRunner
to behave more like the Parameterized
runner does e.g. generate a test with a different name for each parameter read from the input file.
See also: