volosied commented on code in PR #615: URL: https://github.com/apache/myfaces/pull/615#discussion_r1353137293
########## impl/src/main/java/org/apache/myfaces/config/annotation/DefaultAnnotationProvider.java: ########## @@ -128,21 +128,23 @@ public DefaultAnnotationProvider() @Override public Map<Class<? extends Annotation>, Set<Class<?>>> getAnnotatedClasses(ExternalContext ctx) { - if (MyfacesConfig.getCurrentInstance(ctx).isUseCdiForAnnotationScanning()) + //1. Use CDI + BeanManager beanManager = CDIUtils.getBeanManager(ctx); + if(beanManager != null) // shouldnt be null, but needed for our mock junit tests Review Comment: @tandraschko Is it okay if I add a null check here? Otherwise, we'd have to handle the failing `mock` junit tests. - skip them - find some way to enable CDI ( looks tedious as we'll need to create lot of mock objects to replicate the CDIAnnotationDelegateInjectionProvider class) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@myfaces.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org