I am looking for a way to standarize display name in Unit Test using @DisplayName(value = "...")
I would like to create custom annotation:
@TestDisplayName(method = "testMethod", when = "input is null", expected = "should return something"
and use this custom annotation should use JUnit's @DisplayName annotation in this way (inserts @TestDisplayName
's arguments between constant strings):
@DisplayName(value = "Method: " + TestDisplayName.method + " - When: " + TestDisplayName.when + " - Expected: " + TestDisplayName.expected);