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
public static class DisplayNameGenerator.Simple extends DisplayNameGenerator.Standard
SimpleDisplayNameGenerator
that removes trailing parentheses for methods with no parameters.This generator extends the functionality of
DisplayNameGenerator.Standard
by removing parentheses ('()'
) found at the end of method names with no parameters.
-
-
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 Modifier and Type Field Description (package private) static DisplayNameGenerator
INSTANCE
-
Constructor Summary
Constructors Constructor Description Simple()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
generateDisplayNameForMethod(java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
Generate a display name for the given method.private static boolean
hasParameters(java.lang.reflect.Method method)
-
Methods inherited from class org.junit.jupiter.api.DisplayNameGenerator.Standard
generateDisplayNameForClass, generateDisplayNameForNestedClass
-
-
-
-
Field Detail
-
INSTANCE
static final DisplayNameGenerator INSTANCE
-
-
Method Detail
-
generateDisplayNameForMethod
public java.lang.String generateDisplayNameForMethod(java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
Description copied from interface:DisplayNameGenerator
Generate a display name for the given method.- Specified by:
generateDisplayNameForMethod
in interfaceDisplayNameGenerator
- Overrides:
generateDisplayNameForMethod
in classDisplayNameGenerator.Standard
- 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
null
or blank
-
hasParameters
private static boolean hasParameters(java.lang.reflect.Method method)
-
-