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
public static class DisplayNameGenerator.ReplaceUnderscores extends DisplayNameGenerator.Simple
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
-
-
Constructor Summary
Constructors Constructor Description ReplaceUnderscores()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateDisplayNameForClass(Class<?> testClass)
Generate a display name for the given top-level orstatic
nested test class.String
generateDisplayNameForMethod(Class<?> testClass, Method testMethod)
Generate a display name for the given method.String
generateDisplayNameForNestedClass(Class<?> nestedClass)
Generate a display name for the given@Nested
inner test class.
-
-
-
Method Detail
-
generateDisplayNameForClass
public String generateDisplayNameForClass(Class<?> testClass)
Description copied from interface:DisplayNameGenerator
Generate a display name for the given top-level orstatic
nested test class.- Specified by:
generateDisplayNameForClass
in interfaceDisplayNameGenerator
- Overrides:
generateDisplayNameForClass
in classDisplayNameGenerator.Standard
- Parameters:
testClass
- the class to generate a name for; nevernull
- Returns:
- the display name for the class; never
null
or blank
-
generateDisplayNameForNestedClass
public String generateDisplayNameForNestedClass(Class<?> nestedClass)
Description copied from interface:DisplayNameGenerator
Generate a display name for the given@Nested
inner test class.- Specified by:
generateDisplayNameForNestedClass
in interfaceDisplayNameGenerator
- Overrides:
generateDisplayNameForNestedClass
in classDisplayNameGenerator.Standard
- Parameters:
nestedClass
- the class to generate a name for; nevernull
- Returns:
- the display name for the nested class; never
null
or blank
-
generateDisplayNameForMethod
public String generateDisplayNameForMethod(Class<?> testClass, Method testMethod)
Description copied from interface:DisplayNameGenerator
Generate a display name for the given method.- Specified by:
generateDisplayNameForMethod
in interfaceDisplayNameGenerator
- Overrides:
generateDisplayNameForMethod
in classDisplayNameGenerator.Simple
- Parameters:
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
null
or blank
-
-