Module org.junit.jupiter.api
Package org.junit.jupiter.api
Class DisplayNameGenerator.IndicativeSentences
java.lang.Object
org.junit.jupiter.api.DisplayNameGenerator.IndicativeSentences
- All Implemented Interfaces:
DisplayNameGenerator
- Enclosing interface:
DisplayNameGenerator
@API(status=STABLE,
since="5.10")
public static class DisplayNameGenerator.IndicativeSentences
extends Object
implements DisplayNameGenerator
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.
- Since:
- 5.7
-
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
-
Method Summary
Modifier and TypeMethodDescriptiongenerateDisplayNameForClass
(Class<?> testClass) Generate a display name for the given top-level orstatic
nested 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@Nested
inner test class.
-
Constructor Details
-
IndicativeSentences
public IndicativeSentences()
-
-
Method Details
-
generateDisplayNameForClass
Description copied from interface:DisplayNameGenerator
Generate a display name for the given top-level orstatic
nested test class.If it returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForClass
in interfaceDisplayNameGenerator
- Parameters:
testClass
- the class to generate a name for; nevernull
- Returns:
- the display name for the class; never blank
-
generateDisplayNameForNestedClass
Description copied from interface:DisplayNameGenerator
Generate a display name for the given@Nested
inner test class.If it returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForNestedClass
in interfaceDisplayNameGenerator
- 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:DisplayNameGenerator
Generate a display name for the given method.If it returns
null
, the default display name generator will be used instead.- Specified by:
generateDisplayNameForMethod
in interfaceDisplayNameGenerator
- 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 blank
-