Module org.junit.jupiter.api
Package org.junit.jupiter.api
Class DisplayNameGenerator.ReplaceUnderscores
java.lang.Object
org.junit.jupiter.api.DisplayNameGenerator.Standard
org.junit.jupiter.api.DisplayNameGenerator.Simple
org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores
- All Implemented Interfaces:
DisplayNameGenerator
- Enclosing interface:
DisplayNameGenerator
DisplayNameGenerator that replaces underscores with spaces.
This generator extends the functionality of DisplayNameGenerator.Simple by
replacing all underscores ('_') found in class and method names
with spaces (' ').
-
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 orstaticnested test class.generateDisplayNameForMethod(Class<?> testClass, Method testMethod) Generate a display name for the given method.generateDisplayNameForNestedClass(Class<?> nestedClass) Generate a display name for the given@Nestedinner test class.
-
Constructor Details
-
ReplaceUnderscores
public ReplaceUnderscores()
-
-
Method Details
-
generateDisplayNameForClass
Description copied from interface:DisplayNameGeneratorGenerate a display name for the given top-level orstaticnested test class.If it returns
null, the default display name generator will be used instead.- Specified by:
generateDisplayNameForClassin interfaceDisplayNameGenerator- Overrides:
generateDisplayNameForClassin classDisplayNameGenerator.Standard- Parameters:
testClass- the class to generate a name for; nevernull- Returns:
- the display name for the class; never blank
-
generateDisplayNameForNestedClass
Description copied from interface:DisplayNameGeneratorGenerate a display name for the given@Nestedinner test class.If it returns
null, the default display name generator will be used instead.- Specified by:
generateDisplayNameForNestedClassin interfaceDisplayNameGenerator- Overrides:
generateDisplayNameForNestedClassin classDisplayNameGenerator.Standard- Parameters:
nestedClass- the class to generate a name for; nevernull- Returns:
- the display name for the nested class; never blank
-
generateDisplayNameForMethod
Description copied from interface:DisplayNameGeneratorGenerate a display name for the given method.If it returns
null, the default display name generator will be used instead.- Specified by:
generateDisplayNameForMethodin interfaceDisplayNameGenerator- Overrides:
generateDisplayNameForMethodin classDisplayNameGenerator.Simple- Parameters:
testClass- the class the test method is invoked on; nevernulltestMethod- method to generate a display name for; nevernull- Returns:
- the display name for the test; never blank
-