Pragmatists/JUnitParams

Make class name optional in @TestCaseName

haluzpav opened this issue · 0 comments

We can currently annotate the test methods with @TestCaseName("[{index}] {1}, {2} -> {4}") but IntelliJ shows the test case name as MyTestClass.[0] 7, hello -> 3.14. The class name should be optional in the same way as the method name with {method}.

Example code:

@RunWith(JUnitParamsRunner.class)
public class MyTestClass {

    @Test
    @Parameters(method = "data")
    @TestCaseName("[{index}] {1}, {2} -> {4}")
    public void paramsInNamedMethod(int i, int j, String p1, int k, double p2) {
        Assert.assertTrue(p2 < 4);
    }

    private static Object[] data() {
        return new Object[]{0, 7, "hello", 0, 3.14};
    }

}