Top Description Inners Fields Methods
org.junit.jupiter.api

public Interface DisplayNameGenerator

Known Direct Implementers
org.junit.jupiter.api.DisplayNameGenerator.Standard, org.junit.jupiter.api.DisplayNameGenerator.IndicativeSentences
Annotations
@API
status:STABLE
since:5.7
Static Imports
java.util.Collections.emptyList, org.apiguardian.api.API.Status.DEPRECATED, .API.Status.EXPERIMENTAL, .API.Status.INTERNAL, .API.Status.MAINTAINED, .API.Status.STABLE, org.junit.platform.commons.support.AnnotationSupport.findAnnotation, .ModifierSupport.isStatic, org.junit.platform.commons.util.KotlinReflectionUtils.getKotlinSuspendingFunctionParameterTypes, .KotlinReflectionUtils.isKotlinSuspendingFunction

DisplayNameGenerator defines the SPI for generating display names programmatically.

Display names are typically used for test reporting in IDEs and build tools and may contain spaces, special characters, and even emoji.

Concrete implementations must have a default constructor.

A DisplayNameGenerator can be configured globally for the entire test suite via the junit.jupiter.displayname.generator.default configuration parameter (see the User Guide for details) or locally for a test class via the @DisplayNameGeneration annotation.

Built-in Implementations

Since
5.4
See Also
@DisplayName, @DisplayNameGeneration

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DisplayNameGenerator.IndicativeSentences

DisplayNameGenerator that generates complete sentences.

public static class
DisplayNameGenerator.ReplaceUnderscores

DisplayNameGenerator that replaces underscores with spaces.

public static class
DisplayNameGenerator.Simple

Simple DisplayNameGenerator that removes trailing parentheses for methods with no parameters.

public static class
DisplayNameGenerator.Standard

Standard DisplayNameGenerator.

Field Summary

Modifier and TypeField and Description
public static final String
DEFAULT_GENERATOR_PROPERTY_NAME

Property name used to set the default display name generator class name: Supported Values

Supported values include fully qualified class names for types that implement DisplayNameGenerator.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the display name for the class; never blank
generateDisplayNameForClass
(Class<?>
the class to generate a name for; never null
testClass
)

Generate a display name for the given top-level or static nested test class.

public default String

Returns:

the display name for the test; never blank
generateDisplayNameForMethod
(Class<?>
the class the test method is invoked on; never null
testClass
,
Method
method to generate a display name for; never null
testMethod
)
Deprecated since 5.12. in favor of generateDisplayNameForMethod(List, Class, Method)

Generate a display name for the given method.

public default String

Returns:

the display name for the test; never blank
generateDisplayNameForMethod
(List<Class<?>>
the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excluding testClass; never null
enclosingInstanceTypes
,
Class<?>
the class the test method is invoked on; never null
testClass
,
Method
method to generate a display name for; never null
testMethod
)

Generate a display name for the given method.

public default String

Returns:

the display name for the nested class; never blank
generateDisplayNameForNestedClass
(Class<?>
the class to generate a name for; never null
nestedClass
)
Deprecated since 5.12. in favor of generateDisplayNameForNestedClass(List, Class)

Generate a display name for the given @Nested inner test class.

public default String

Returns:

the display name for the nested class; never blank
generateDisplayNameForNestedClass
(List<Class<?>>
the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excluding nestedClass; never null
enclosingInstanceTypes
,
Class<?>
the class to generate a name for; never null
nestedClass
)

Generate a display name for the given @Nested inner test class.

public static DisplayNameGenerator

Returns:

a DisplayNameGenerator implementation instance
getDisplayNameGenerator
(Class<?>
the generator's Class; never null, has to be a DisplayNameGenerator implementation
generatorClass
)

Return the DisplayNameGenerator instance corresponding to the given Class.

public static String

Returns:

a string representation of all parameter types of the supplied method or "()" if the method declares no parameters
parameterTypesAsString
(Method
the method from to extract the parameter types from; never null
method
)

Generate a string representation of the formal parameters of the supplied method, consisting of the simple names of the parameter types, separated by commas, and enclosed in parentheses.

Field Detail

DEFAULT_GENERATOR_PROPERTY_NAMEback to summary
public static final String DEFAULT_GENERATOR_PROPERTY_NAME

Property name used to set the default display name generator class name:

Supported Values

Supported values include fully qualified class names for types that implement DisplayNameGenerator.

If not specified, the default is DisplayNameGenerator.Standard.

Annotations
@API
status:STABLE
since:5.9
Since
5.5

Method Detail

generateDisplayNameForClassback to summary
public String generateDisplayNameForClass(Class<?> testClass)

Generate a display name for the given top-level or static nested test class.

If this method returns null, the default display name generator will be used instead.

Parameters
testClass:Class<?>

the class to generate a name for; never null

Returns:String

the display name for the class; never blank

generateDisplayNameForMethodback to summary
public default String generateDisplayNameForMethod(Class<?> testClass, Method testMethod)

Deprecated

since 5.12.

in favor of generateDisplayNameForMethod(List, Class, Method)

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Implementation Note

The class instance supplied as testClass may differ from the class returned by testMethod.getDeclaringClass() — for example, when a test method is inherited from a superclass.

Parameters
testClass:Class<?>

the class the test method is invoked on; never null

testMethod:Method

method to generate a display name for; never null

Returns:String

the display name for the test; never blank

Annotations
@API
status:DEPRECATED
since:5.12
@Deprecated
since:5.12
generateDisplayNameForMethodback to summary
public default String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Implementation Note

The classes supplied as enclosingInstanceTypes may differ from the classes returned from invocations of Class#getEnclosingClass() — for example, when a nested test class is inherited from a superclass. Similarly, the class instance supplied as testClass may differ from the class returned by testMethod.getDeclaringClass() — for example, when a test method is inherited from a superclass.

Parameters
enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excluding testClass; never null

testClass:Class<?>

the class the test method is invoked on; never null

testMethod:Method

method to generate a display name for; never null

Returns:String

the display name for the test; never blank

Annotations
@API
status:MAINTAINED
since:5.13.3
Since
5.12
generateDisplayNameForNestedClassback to summary
public default String generateDisplayNameForNestedClass(Class<?> nestedClass)

Deprecated

since 5.12.

in favor of generateDisplayNameForNestedClass(List, Class)

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.

Parameters
nestedClass:Class<?>

the class to generate a name for; never null

Returns:String

the display name for the nested class; never blank

Annotations
@API
status:DEPRECATED
since:5.12
@Deprecated
since:5.12
generateDisplayNameForNestedClassback to summary
public default String generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

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.

Implementation Note

The classes supplied as enclosingInstanceTypes may differ from the classes returned from invocations of Class#getEnclosingClass() — for example, when a nested test class is inherited from a superclass.

Parameters
enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excluding nestedClass; never null

nestedClass:Class<?>

the class to generate a name for; never null

Returns:String

the display name for the nested class; never blank

Annotations
@API
status:MAINTAINED
since:5.13.3
Since
5.12
getDisplayNameGeneratorback to summary
public static DisplayNameGenerator getDisplayNameGenerator(Class<?> generatorClass)

Return the DisplayNameGenerator instance corresponding to the given Class.

Parameters
generatorClass:Class<?>

the generator's Class; never null, has to be a DisplayNameGenerator implementation

Returns:DisplayNameGenerator

a DisplayNameGenerator implementation instance

parameterTypesAsStringback to summary
public static String parameterTypesAsString(Method method)

Generate a string representation of the formal parameters of the supplied method, consisting of the simple names of the parameter types, separated by commas, and enclosed in parentheses.

Parameters
method:Method

the method from to extract the parameter types from; never null

Returns:String

a string representation of all parameter types of the supplied method or "()" if the method declares no parameters

org.junit.jupiter.api back to summary

public Class DisplayNameGenerator.IndicativeSentences

extends Object
implements DisplayNameGenerator
Class Inheritance
  • java.lang.Object
  • org.junit.jupiter.api.DisplayNameGenerator.IndicativeSentences
All Implemented Interfaces
org.junit.jupiter.api.DisplayNameGenerator
Annotations
@API
status:STABLE
since:5.10

DisplayNameGenerator that generates complete sentences.

This generator generates display names that build up complete sentences by concatenating the names of the test and the enclosing classes. The sentence fragments are concatenated using a separator. The separator and the display name generator for individual sentence fragments can be configured via the @IndicativeSentencesGeneration annotation.

If you do not want to rely on a display name generator for individual sentence fragments, you can supply custom text for individual fragments via the @SentenceFragment annotation.

Since
5.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
DisplayNameGenerator.IndicativeSentences.SentenceFragment

@SentenceFragment is used to configure a custom sentence fragment for a sentence generated by the IndicativeSentences DisplayNameGenerator.

Field Summary

Modifier and TypeField and Description
pack-priv static final DisplayNameGenerator
private static final Predicate<Class<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Optional<DisplayNameGeneration>

Returns:

an Optional containing the annotation, potentially empty if not found
findDisplayNameGeneration
(Class<?>
the test class on which to find the annotation; never null
testClass
,
List<Class<?>>
the runtime types of the enclosing instances; never null
enclosingInstanceTypes
)

Find the first DisplayNameGeneration annotation that is either directly present, meta-present, or indirectly present on the supplied testClass or on an enclosing instance type.

private static Optional<IndicativeSentencesGeneration>

Returns:

an Optional containing the annotation, potentially empty if not found
findIndicativeSentencesGeneration
(Class<?>
the test class on which to find the annotation; never null
testClass
,
List<Class<?>>
the runtime types of the enclosing instances; never null
enclosingInstanceTypes
)

Find the first IndicativeSentencesGeneration annotation that is either directly present, meta-present, or indirectly present on the supplied testClass or on an enclosing instance type.

public String
generateDisplayNameForClass(Class<?> testClass)

Implements org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Generate a display name for the given top-level or static nested test class.

public String
generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

public String
generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

Generate a display name for the given @Nested inner test class.

private static String

Returns:

the sentence fragment separator
getFragmentSeparator
(Class<?>
the test class to search on for @IndicativeSentencesGeneration
testClass
,
List<Class<?>>
the runtime types of the enclosing instances; never null
enclosingInstanceTypes
)

Get the sentence fragment separator.

private static DisplayNameGenerator

Returns:

the DisplayNameGenerator instance to use
getGeneratorFor
(Class<?>
the test class to search on for @IndicativeSentencesGeneration
testClass
,
List<Class<?>>
the runtime types of the enclosing instances; never null
enclosingInstanceTypes
)

Get the display name generator to use for the supplied test class.

private String
getSentenceBeginning(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)

private static @Nullable String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
pack-priv static final DisplayNameGenerator INSTANCE
notIndicativeSentencesback to summary
private static final Predicate<Class<?>> notIndicativeSentences

Constructor Detail

IndicativeSentencesback to summary
public IndicativeSentences()

Method Detail

findDisplayNameGenerationback to summary
private static Optional<DisplayNameGeneration> findDisplayNameGeneration(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)

Find the first DisplayNameGeneration annotation that is either directly present, meta-present, or indirectly present on the supplied testClass or on an enclosing instance type.

Parameters
testClass:Class<?>

the test class on which to find the annotation; never null

enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances; never null

Returns:Optional<DisplayNameGeneration>

an Optional containing the annotation, potentially empty if not found

Annotations
@API
status:INTERNAL
since:5.12
findIndicativeSentencesGenerationback to summary
private static Optional<IndicativeSentencesGeneration> findIndicativeSentencesGeneration(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)

Find the first IndicativeSentencesGeneration annotation that is either directly present, meta-present, or indirectly present on the supplied testClass or on an enclosing instance type.

Parameters
testClass:Class<?>

the test class on which to find the annotation; never null

enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances; never null

Returns:Optional<IndicativeSentencesGeneration>

an Optional containing the annotation, potentially empty if not found

generateDisplayNameForClassback to summary
public String generateDisplayNameForClass(Class<?> testClass)

Implements org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Generate a display name for the given top-level or static nested test class.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForMethodback to summary
public String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForNestedClassback to summary
public String generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

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.

Annotations
@Override
getFragmentSeparatorback to summary
private static String getFragmentSeparator(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)

Get the sentence fragment separator.

If @IndicativeSentencesGeneration is present (searching enclosing classes if not found locally), the configured separator will be used. Otherwise, IndicativeSentencesGeneration#DEFAULT_SEPARATOR will be used.

Parameters
testClass:Class<?>

the test class to search on for @IndicativeSentencesGeneration

enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances; never null

Returns:String

the sentence fragment separator

getGeneratorForback to summary
private static DisplayNameGenerator getGeneratorFor(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)

Get the display name generator to use for the supplied test class.

If @IndicativeSentencesGeneration is present (searching enclosing classes if not found locally), the configured generator will be used. Otherwise, IndicativeSentencesGeneration#DEFAULT_GENERATOR will be used.

Parameters
testClass:Class<?>

the test class to search on for @IndicativeSentencesGeneration

enclosingInstanceTypes:List<Class<?>>

the runtime types of the enclosing instances; never null

Returns:DisplayNameGenerator

the DisplayNameGenerator instance to use

getSentenceBeginningback to summary
private String getSentenceBeginning(Class<?> testClass, List<Class<?>> enclosingInstanceTypes)
getSentenceFragmentback to summary
private static @Nullable String getSentenceFragment(AnnotatedElement element)
org.junit.jupiter.api back to summary

public @Interface DisplayNameGenerator.IndicativeSentences.SentenceFragment

extends Annotation
Annotations
@Target:TYPE, METHOD
@Retention:RUNTIME
@API
status:EXPERIMENTAL
since:6.0

@SentenceFragment is used to configure a custom sentence fragment for a sentence generated by the IndicativeSentences DisplayNameGenerator.

Note that @DisplayName always takes precedence over @SentenceFragment.

Since
5.13

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a custom sentence fragment; never blank or consisting solely of whitespace
value
()

Custom sentence fragment for the annotated class or method.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String value()

Custom sentence fragment for the annotated class or method.

Returns:String

a custom sentence fragment; never blank or consisting solely of whitespace

org.junit.jupiter.api back to summary

public Class DisplayNameGenerator.ReplaceUnderscores

extends Simple
Class Inheritance

DisplayNameGenerator that replaces underscores with spaces.

This generator extends the functionality of Simple by replacing all underscores ('_') found in class and method names with spaces (' ').

Field Summary

Modifier and TypeField and Description
pack-priv static final DisplayNameGenerator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Simple.generateDisplayNameForMethod.

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

public String
private static String

Field Detail

INSTANCEback to summary
pack-priv static final DisplayNameGenerator INSTANCE

Hides org.junit.jupiter.api.DisplayNameGenerator.Simple.INSTANCE.

Constructor Detail

ReplaceUnderscoresback to summary
public ReplaceUnderscores()

Method Detail

generateDisplayNameForClassback to summary
public String generateDisplayNameForClass(Class<?> testClass)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Standard.generateDisplayNameForClass.

Implements org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Generate a display name for the given top-level or static nested test class.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForMethodback to summary
public String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Simple.generateDisplayNameForMethod.

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForNestedClassback to summary
public String generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Standard.generateDisplayNameForNestedClass.

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

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.

Annotations
@Override
replaceUnderscoresback to summary
private static String replaceUnderscores(String name)
org.junit.jupiter.api back to summary

public Class DisplayNameGenerator.Simple

extends Standard
Class Inheritance
Known Direct Subclasses
org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores
Annotations
@API
status:STABLE
since:5.7

Simple DisplayNameGenerator that removes trailing parentheses for methods with no parameters.

This generator extends the functionality of Standard by removing parentheses ('()') found at the end of method names with no parameters.

Since
5.7

Field Summary

Modifier and TypeField and Description
pack-priv static final DisplayNameGenerator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Standard.generateDisplayNameForMethod.

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

private static boolean
Inherited from org.junit.jupiter.api.DisplayNameGenerator.Standard:
generateDisplayNameForClassgenerateDisplayNameForNestedClass

Field Detail

INSTANCEback to summary
pack-priv static final DisplayNameGenerator INSTANCE

Hides org.junit.jupiter.api.DisplayNameGenerator.Standard.INSTANCE.

Constructor Detail

Simpleback to summary
public Simple()

Method Detail

generateDisplayNameForMethodback to summary
public String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides org.junit.jupiter.api.DisplayNameGenerator.Standard.generateDisplayNameForMethod.

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
hasParametersback to summary
private static boolean hasParameters(Method method)
org.junit.jupiter.api back to summary

public Class DisplayNameGenerator.Standard

extends Object
implements DisplayNameGenerator
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.DisplayNameGenerator
Known Direct Subclasses
org.junit.jupiter.api.DisplayNameGenerator.Simple

Standard DisplayNameGenerator.

This implementation matches the standard display name generation behavior in place since JUnit Jupiter was introduced.

Field Summary

Modifier and TypeField and Description
pack-priv static final DisplayNameGenerator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
generateDisplayNameForClass(Class<?> testClass)

Implements org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Generate a display name for the given top-level or static nested test class.

public String
generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

public String
generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

Generate a display name for the given @Nested inner test class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
pack-priv static final DisplayNameGenerator INSTANCE

Constructor Detail

Standardback to summary
public Standard()

Method Detail

generateDisplayNameForClassback to summary
public String generateDisplayNameForClass(Class<?> testClass)

Implements org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForClass.

Generate a display name for the given top-level or static nested test class.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForMethodback to summary
public String generateDisplayNameForMethod(List<Class<?>> enclosingInstanceTypes, Class<?> testClass, Method testMethod)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod.

Generate a display name for the given method.

If this method returns null, the default display name generator will be used instead.

Annotations
@Override
generateDisplayNameForNestedClassback to summary
public String generateDisplayNameForNestedClass(List<Class<?>> enclosingInstanceTypes, Class<?> nestedClass)

Overrides default org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

Doc from org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass.

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.

Annotations
@Override