@API(status=EXPERIMENTAL,
since="5.4")
public interface DisplayNameGenerator
DisplayNameGenerator defines the SPI for generating display
names programmatically.
An implementation must provide an accessible no-arg constructor.
DisplayName,
DisplayNameGeneration| Modifier and Type | Interface and Description |
|---|---|
static class |
DisplayNameGenerator.ReplaceUnderscores
Replace all underscore characters with spaces.
|
static class |
DisplayNameGenerator.Standard
Standard display name generator.
|
| Modifier and Type | Method and Description |
|---|---|
String |
generateDisplayNameForClass(Class<?> testClass)
Generate a display name for the given top-level or
static 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. |
static String |
parameterTypesAsString(Method method)
Compile a string representation from all simple parameter type names.
|
String generateDisplayNameForClass(Class<?> testClass)
static nested test class.testClass - the class generate a name for; never nullnull or blankString generateDisplayNameForNestedClass(Class<?> nestedClass)
@Nested inner test class.nestedClass - the class generate a name for; never nullnull or blankString generateDisplayNameForMethod(Class<?> testClass, Method testMethod)
testClass - the class the test method is invoked on; never nulltestMethod - method to generate a display name for; never nullnull or blankstatic String parameterTypesAsString(Method method)
method - the method providing parameter types for the result; never null"()" if the method has no parametersCopyright © 2024. All rights reserved.