Class AnnotationHelper


  • public final class AnnotationHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <A extends java.lang.annotation.Annotation>
      java.util.Optional<A>
      findOptionalAnnotation​(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.Class<A> annotationType)
      Try to find if the annotation in the class or any parent it is Inherited.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findOptionalAnnotation

        public static <A extends java.lang.annotation.Annotation> java.util.Optional<A> findOptionalAnnotation​(org.junit.jupiter.api.extension.ExtensionContext context,
                                                                                                               java.lang.Class<A> annotationType)
        Try to find if the annotation in the class or any parent it is Inherited.
        Type Parameters:
        A - the returned type should be the same as the annotation class.
        Parameters:
        context - ExtensionContext starting context to find annotation from the test class.
        annotationType - the annotation class to lookup for.
        Returns:
        an optional object filled with the annotation if found.