[ 
https://issues.apache.org/jira/browse/SUREFIRE-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashley Scopes updated SUREFIRE-2101:
------------------------------------
    Description: 
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}}.

 !example-reproduction.png! 

  was:
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}}.


> 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
>            Priority: Minor
>         Attachments: example-reproduction.png
>
>
> 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}}.
>  !example-reproduction.png! 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to