You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ashley Scopes (Jira)" <ji...@apache.org> on 2022/06/19 12:50:00 UTC
[jira] [Created] (SUREFIRE-2101) Phrased test names with missing @DisplayName result in a "null" test name
Ashley Scopes created SUREFIRE-2101:
---------------------------------------
Summary: Phrased test names with missing @DisplayName result in a "null" test name
Key: SUREFIRE-2101
URL: https://issues.apache.org/jira/browse/SUREFIRE-2101
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin
Affects Versions: 3.0.0-M7
Environment: All platforms
Reporter: Ashley Scopes
If I enable phrased test naming in config, and then write a test such as the following:
{code:java}
// Note no @DisplayName("...")
class SomeTest {
void fooHasThreeCharacters() {
assertThat(foo).hasSize(3)
}
}
{code}
...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}}.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)