Package org.junit.jupiter.api
Class DisplayNameGenerator.Simple
- java.lang.Object
-
- org.junit.jupiter.api.DisplayNameGenerator.Standard
-
- org.junit.jupiter.api.DisplayNameGenerator.Simple
-
- All Implemented Interfaces:
DisplayNameGenerator
- Direct Known Subclasses:
DisplayNameGenerator.ReplaceUnderscores
- Enclosing interface:
- DisplayNameGenerator
@API(status=STABLE, since="5.7") public static class DisplayNameGenerator.Simple extends DisplayNameGenerator.StandardSimpleDisplayNameGeneratorthat removes trailing parentheses for methods with no parameters.This generator extends the functionality of
DisplayNameGenerator.Standardby removing parentheses ('()') found at the end of method names with no parameters.- 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
Constructors Constructor Description Simple()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgenerateDisplayNameForMethod(java.util.List<java.lang.Class<?>> enclosingInstanceTypes, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)Generate a display name for the given method.-
Methods inherited from class org.junit.jupiter.api.DisplayNameGenerator.Standard
generateDisplayNameForClass, generateDisplayNameForNestedClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.junit.jupiter.api.DisplayNameGenerator
generateDisplayNameForMethod, generateDisplayNameForNestedClass
-
-
-
-
Method Detail
-
generateDisplayNameForMethod
public java.lang.String generateDisplayNameForMethod(java.util.List<java.lang.Class<?>> enclosingInstanceTypes, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)Description copied from interface:DisplayNameGeneratorGenerate a display name for the given method.If this method returns
null, the default display name generator will be used instead.- Specified by:
generateDisplayNameForMethodin interfaceDisplayNameGenerator- Overrides:
generateDisplayNameForMethodin classDisplayNameGenerator.Standard- Parameters:
enclosingInstanceTypes- the runtime types of the enclosing instances for the test class, ordered from outermost to innermost, excludingtestClass; nevernulltestClass- the class the test method is invoked on; nevernulltestMethod- method to generate a display name for; nevernull- Returns:
- the display name for the test; never blank
-
-