public static Map < String , Method > getAllCucumberMethods ( Class < ? > clazz ) { final Map < String , Method > result = new HashMap <> ( ) ; final CucumberOptions co = clazz . getAnnotation ( CucumberOptions . class ) ; final Set < Class < ? > > classes = getClasses ( co . glue ( ) ) ; classes . add ( BrowserSteps . class ) ; for ( final Class < ? > c : classes ) { final Method [ ] methods = c . getDeclaredMethods ( ) ; for ( final Method method : methods ) { for ( final Annotation stepAnnotation : method . getAnnotations ( ) ) { if ( stepAnnotation . annotationType ( ) . isAnnotationPresent ( StepDefAnnotation . class ) ) { result . put ( stepAnnotation . toString ( ) , method ) ; } } } } return result ; }
Gets all Cucumber methods .