java.lang.Object
org.junit.jupiter.api.DisplayNameGenerator.Standard
- All Implemented Interfaces:
DisplayNameGenerator
- Direct Known Subclasses:
DisplayNameGenerator.Simple
- Enclosing interface:
DisplayNameGenerator
Standard
DisplayNameGenerator
.
This implementation matches the standard display name generation behavior in place since JUnit Jupiter 5.0 was released.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.DisplayNameGenerator
DisplayNameGenerator.IndicativeSentences, DisplayNameGenerator.ReplaceUnderscores, DisplayNameGenerator.Simple, DisplayNameGenerator.Standard
-
Field Summary
Fields inherited from interface org.junit.jupiter.api.DisplayNameGenerator
DEFAULT_GENERATOR_PROPERTY_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateDisplayNameForClass
(Class<?> testClass) Generate a display name for the given top-level orstatic
nested test class.generateDisplayNameForMethod
(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod) Generate a display name for the given method.generateDisplayNameForNestedClass
(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass) Generate a display name for the given@Nested
inner test class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.jupiter.api.DisplayNameGenerator
generateDisplayNameForMethod, generateDisplayNameForNestedClass
-
Constructor Details
-
Standard
public Standard()
-
-
Method Details
-
generateDisplayNameForClass
Description copied from interface:DisplayNameGenerator
Generate a display name for the given top-level orstatic
nested test class.If this method returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForClass
in interfaceDisplayNameGenerator
- Parameters:
testClass
- the class to generate a name for; nevernull
- Returns:
- the display name for the class; never blank
-
generateDisplayNameForNestedClass
public String generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass) Description copied from interface:DisplayNameGenerator
Generate a display name for the given@Nested
inner test class.If this method returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForNestedClass
in interfaceDisplayNameGenerator
- Parameters:
enclosingInstanceTypes
- the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excludingnestedClass
; nevernull
nestedClass
- the class to generate a name for; nevernull
- Returns:
- the display name for the nested class; never blank
-
generateDisplayNameForMethod
public String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod) Description copied from interface:DisplayNameGenerator
Generate a display name for the given method.If this method returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForMethod
in interfaceDisplayNameGenerator
- Parameters:
enclosingInstanceTypes
- the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excludingtestClass
; nevernull
testClass
- the class the test method is invoked on; nevernull
testMethod
- method to generate a display name for; nevernull
- Returns:
- the display name for the test; never blank
-