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 (' ').
DisplayNameGenerator.IndicativeSentences, DisplayNameGenerator.ReplaceUnderscores, DisplayNameGenerator.Simple, DisplayNameGenerator.Standard| Modifier and Type | Field and Description |
|---|---|
(package private) static DisplayNameGenerator |
INSTANCE |
DEFAULT_GENERATOR_PROPERTY_NAME| Constructor and Description |
|---|
ReplaceUnderscores() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
generateDisplayNameForClass(java.lang.Class<?> testClass)
Generate a display name for the given top-level or
static nested test class. |
java.lang.String |
generateDisplayNameForMethod(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod)
Generate a display name for the given method.
|
java.lang.String |
generateDisplayNameForNestedClass(java.lang.Class<?> nestedClass)
Generate a display name for the given
@Nested inner test class. |
private static java.lang.String |
replaceUnderscores(java.lang.String name) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDisplayNameGenerator, parameterTypesAsStringstatic final DisplayNameGenerator INSTANCE
public java.lang.String generateDisplayNameForClass(java.lang.Class<?> testClass)
DisplayNameGeneratorstatic nested test class.
If it returns null, the default display name generator will be used instead.
generateDisplayNameForClass in interface DisplayNameGeneratorgenerateDisplayNameForClass in class DisplayNameGenerator.StandardtestClass - the class to generate a name for; never nullpublic java.lang.String generateDisplayNameForNestedClass(java.lang.Class<?> nestedClass)
DisplayNameGenerator@Nested inner test class.
If it returns null, the default display name generator will be used instead.
generateDisplayNameForNestedClass in interface DisplayNameGeneratorgenerateDisplayNameForNestedClass in class DisplayNameGenerator.StandardnestedClass - the class to generate a name for; never nullpublic java.lang.String generateDisplayNameForMethod(java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod)
DisplayNameGeneratorIf it returns null, the default display name generator will be used instead.
generateDisplayNameForMethod in interface DisplayNameGeneratorgenerateDisplayNameForMethod in class DisplayNameGenerator.SimpletestClass - the class the test method is invoked on; never nulltestMethod - method to generate a display name for; never nullprivate static java.lang.String replaceUnderscores(java.lang.String name)