Class DisplayNameGenerator.Standard

java.lang.Object
org.junit.jupiter.api.DisplayNameGenerator.Standard
All Implemented Interfaces:
DisplayNameGenerator
Direct Known Subclasses:
DisplayNameGenerator.Simple
Enclosing interface:
DisplayNameGenerator

public static class DisplayNameGenerator.Standard extends Object implements DisplayNameGenerator
Standard DisplayNameGenerator.

This implementation matches the standard display name generation behavior in place since JUnit Jupiter 5.0 was released.

  • Constructor Details

    • Standard

      public Standard()
  • Method Details

    • generateDisplayNameForClass

      public String generateDisplayNameForClass(Class<?> testClass)
      Description copied from interface: DisplayNameGenerator
      Generate a display name for the given top-level or static nested test class.

      If it returns null, the default display name generator will be used instead.

      Specified by:
      generateDisplayNameForClass in interface DisplayNameGenerator
      Parameters:
      testClass - the class to generate a name for; never null
      Returns:
      the display name for the class; never blank
    • generateDisplayNameForNestedClass

      public String generateDisplayNameForNestedClass(Class<?> nestedClass)
      Description copied from interface: DisplayNameGenerator
      Generate a display name for the given @Nested inner test class.

      If it returns null, the default display name generator will be used instead.

      Specified by:
      generateDisplayNameForNestedClass in interface DisplayNameGenerator
      Parameters:
      nestedClass - the class to generate a name for; never null
      Returns:
      the display name for the nested class; never blank
    • generateDisplayNameForMethod

      public String generateDisplayNameForMethod(Class<?> testClass, Method testMethod)
      Description copied from interface: DisplayNameGenerator
      Generate a display name for the given method.

      If it returns null, the default display name generator will be used instead.

      Specified by:
      generateDisplayNameForMethod in interface DisplayNameGenerator
      Parameters:
      testClass - the class the test method is invoked on; never null
      testMethod - method to generate a display name for; never null
      Returns:
      the display name for the test; never blank