Skip to content

[SUREFIRE-2101] Phrased test names with missing @DisplayName result in a "null" test name #2836

@jira-importer

Description

@jira-importer

Ashley Scopes opened SUREFIRE-2101 and commented

If I enable phrased test naming in config, and then write a test such as the following:

// Note no @DisplayName("...")
class SomeTest {
  void fooHasThreeCharacters() {
    assertThat(foo).hasSize(3);
  }
}

...then the console reports will contain a null name rather than something meaningful.

I am proposing that when this phrased name is unavailable, Surefire should fall back to the original test name that would have been provided if phrased naming was disabled. The reasoning behind this is that showing an unformatted class name is more useful to the developer reading Maven logs than just the phrase null.

!example-reproduction.png!


Affects: 3.0.0-M7

Attachments:

Remote Links:

Metadata

Metadata

Labels

bugSomething isn't workingpriority:minorMinor loss of function, or other problem where easy workaround is present

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions