Skip to content

Show display name in the test report #956

Closed

Description

I've overridden the display name with a generator but it's not being honored the runner.

@DisplayNameGeneration(ReplaceCamelCase.class)
class LibraryTest {
  //...
}

VS Code Test Runner Output

image

Code is being called 🤔🤷‍♂️

image

private String replaceCapitals(String name) {
  name = name.replaceAll("([A-Z])", " $1");
  name = name.replaceAll("([0-9]+)", " $1");
  System.out.println(String.format("new test name: '%s'", name));
  return name;
}

Full sample

Reference: Building a Camel Case @DisplayNameGenerator For JUnit 5

Activity

  1. spottedmahn commented on Mar 7, 2020

    @spottedmahn
    Author

    Apparently it's not specific to generators... the simple case doesn't work either:

    image

  2. jdneo commented on Mar 7, 2020

    @jdneo
    Member

    display name generator is duplicated with #667

    But I will change this issue's title to: Show display name in the test report.

  3. changed the title [-]DisplayNameGenerator not honored[/-] [+]Show display name in the test report[/+] on Mar 7, 2020
  4. added this to the 0.31.0 milestone on Aug 5, 2021
  5. jdneo commented on Aug 6, 2021

    @jdneo
    Member

    Supported in 0.31.0 in test explorer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions