When you run a JUnit 4 ParameterizedTest with the Eclipse TestRunner, the graphical representation is rather dumb: for each test you have a node called [0]
, [
If you use JUnitParams library (as I have described here), the parameterized tests will have their stringified parameters as their own default test names.
Moreover, you can see in their samples, that JUnitParams also allows you to have a custom test name by using @TestCaseName
:
@Test @Parameters({ "1,1", "2,2", "3,6" }) @TestCaseName("factorial({0}) = {1}") public void custom_names_for_test_case(int argument, int result) { }
@Test @Parameters({ "value1, value2", "value3, value4" }) @TestCaseName("[{index}] {method}: {params}") public void predefined_macro_for_test_case_name(String param1, String param2) { }