Class DefaultMethodDescriptor
java.lang.Object
org.junit.jupiter.engine.discovery.DefaultMethodDescriptor
- All Implemented Interfaces:
MethodDescriptor
Default implementation of
MethodDescriptor
, backed by
a MethodBasedTestDescriptor
.- Since:
- 5.4
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
Optional<A> findAnnotation
(Class<A> annotationType) Find the first annotation ofannotationType
that is either present or meta-present on theMethod
for this descriptor.<A extends Annotation>
List<A> findRepeatableAnnotations
(Class<A> annotationType) Find all repeatable annotations ofannotationType
that are either present or meta-present on theMethod
for this descriptor.final String
Get the display name for this descriptor'smethod
.final Method
Get the method for this descriptor.(package private) MethodBasedTestDescriptor
boolean
isAnnotated
(Class<? extends Annotation> annotationType) Determine if an annotation ofannotationType
is either present or meta-present on theMethod
for this descriptor.toString()
-
Field Details
-
testDescriptor
-
-
Constructor Details
-
DefaultMethodDescriptor
DefaultMethodDescriptor(MethodBasedTestDescriptor testDescriptor)
-
-
Method Details
-
getTestDescriptor
MethodBasedTestDescriptor getTestDescriptor() -
getMethod
Description copied from interface:MethodDescriptor
Get the method for this descriptor.- Specified by:
getMethod
in interfaceMethodDescriptor
- Returns:
- the method; never
null
-
getDisplayName
Description copied from interface:MethodDescriptor
Get the display name for this descriptor'smethod
.- Specified by:
getDisplayName
in interfaceMethodDescriptor
- Returns:
- the display name for this descriptor's method; never
null
or blank
-
isAnnotated
Description copied from interface:MethodDescriptor
Determine if an annotation ofannotationType
is either present or meta-present on theMethod
for this descriptor.- Specified by:
isAnnotated
in interfaceMethodDescriptor
- Parameters:
annotationType
- the annotation type to search for; nevernull
- Returns:
true
if the annotation is present or meta-present- See Also:
-
findAnnotation
Description copied from interface:MethodDescriptor
Find the first annotation ofannotationType
that is either present or meta-present on theMethod
for this descriptor.- Specified by:
findAnnotation
in interfaceMethodDescriptor
- Type Parameters:
A
- the annotation type- Parameters:
annotationType
- the annotation type to search for; nevernull
- Returns:
- an
Optional
containing the annotation; nevernull
but potentially empty - See Also:
-
findRepeatableAnnotations
Description copied from interface:MethodDescriptor
Find all repeatable annotations ofannotationType
that are either present or meta-present on theMethod
for this descriptor.- Specified by:
findRepeatableAnnotations
in interfaceMethodDescriptor
- Type Parameters:
A
- the annotation type- Parameters:
annotationType
- the repeatable annotation type to search for; nevernull
- Returns:
- the list of all such annotations found; neither
null
nor mutable, but potentially empty - See Also:
-
toString
-