New test runner reports are really weird for parameterized tests #1296
Closed
Description
opened on Aug 27, 2021
Consider for instance this test where method
is run twice and will once pass and once fail.
@RunWith(Parameterized.class)
public class MyTest {
@Parameters
public static Integer[] data() {
return new Integer[] { 1, 2 };
}
private Integer id;
public MyTest(Integer id) {
this.id = id;
}
@Test
public void method() {
Assert.assertEquals(Integer.valueOf(1), id);
}
}
Changing the method to assert the value is 2 gives
At this point I no longer have any idea of what is going on. The is no indication anywhere about two tests being run as far as I can see.
If I add
@Rule
public TestName testName = new TestName();
and
System.out.println("Name: " + testName.getMethodName());
I can see that the tests are actually named
Name: method[0]
Name: method[1]
but the popup only shows method
Activity