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 ofannotationTypethat is either present or meta-present on theMethodfor this descriptor.<A extends Annotation>
List<A> findRepeatableAnnotations(Class<A> annotationType) Find all repeatable annotations ofannotationTypethat are either present or meta-present on theMethodfor this descriptor.final StringGet the display name for this descriptor'smethod.final MethodGet the method for this descriptor.(package private) MethodBasedTestDescriptorbooleanisAnnotated(Class<? extends Annotation> annotationType) Determine if an annotation ofannotationTypeis either present or meta-present on theMethodfor this descriptor.toString()
-
Field Details
-
testDescriptor
-
-
Constructor Details
-
DefaultMethodDescriptor
DefaultMethodDescriptor(MethodBasedTestDescriptor testDescriptor)
-
-
Method Details
-
getTestDescriptor
MethodBasedTestDescriptor getTestDescriptor() -
getMethod
Description copied from interface:MethodDescriptorGet the method for this descriptor.- Specified by:
getMethodin interfaceMethodDescriptor- Returns:
- the method; never
null
-
getDisplayName
Description copied from interface:MethodDescriptorGet the display name for this descriptor'smethod.- Specified by:
getDisplayNamein interfaceMethodDescriptor- Returns:
- the display name for this descriptor's method; never
nullor blank
-
isAnnotated
Description copied from interface:MethodDescriptorDetermine if an annotation ofannotationTypeis either present or meta-present on theMethodfor this descriptor.- Specified by:
isAnnotatedin interfaceMethodDescriptor- Parameters:
annotationType- the annotation type to search for; nevernull- Returns:
trueif the annotation is present or meta-present- See Also:
-
findAnnotation
Description copied from interface:MethodDescriptorFind the first annotation ofannotationTypethat is either present or meta-present on theMethodfor this descriptor.- Specified by:
findAnnotationin interfaceMethodDescriptor- Type Parameters:
A- the annotation type- Parameters:
annotationType- the annotation type to search for; nevernull- Returns:
- an
Optionalcontaining the annotation; nevernullbut potentially empty - See Also:
-
findRepeatableAnnotations
Description copied from interface:MethodDescriptorFind all repeatable annotations ofannotationTypethat are either present or meta-present on theMethodfor this descriptor.- Specified by:
findRepeatableAnnotationsin 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
nullnor mutable, but potentially empty - See Also:
-
toString
-