Introduce ExtensionContext.getEnclosingTestClasses()
for use with AnnotationSupport
#4375
Closed
1 task done
In #4131, the
AnnotationSupport.findAnnotation(Class, Class, SearchOption)
method was deprecated in favor of the newAnnotationSupport.findAnnotation(Class, Class, List)
method. When called withSearchOption.INCLUDE_ENCLOSING_CLASSES
it looks up annotations on the passed class or its static enclosed types. In the context of@Nested
tests that was not correct, as annotations (such as@DisplayNameGeneration
) need to be looked up on the runtime enclosing types which differ in case a@Nested
class is declared in a superclass of the test class.In order to call the new method,
ExtensionContext
should provide agetEnclosingTestClasses(): List<Class<?>>
method that can be passed like this:Deliverables
ExtensionContext.getEnclosingTestClasses()
methodThe text was updated successfully, but these errors were encountered: