You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wondered why I had to specify @AddBeanClass with a class the same test inherited an injected field of that type. The bean class would have been found and added automatically if the injected field would have been on the test class itself as opposed to inherited. Weld also makes no such difference on whether injected fields are inherited or not so I figure weld-junit should follow the same rules with @EnableAutoWeld mode as well.
My guess is that there was an error in ClassScanning's method formerly named findAnnotatedFields and now renamed to findAnnotatedDeclaredFields having called getDeclaredFields which excludes inherited fields but the name of that method formerly named findAnnotatedFields did not reflect this restriction and was missed where it is used in scanForRequiredBeanClasses.
I wondered why I had to specify @AddBeanClass with a class the same test inherited an injected field of that type. The bean class would have been found and added automatically if the injected field would have been on the test class itself as opposed to inherited. Weld also makes no such difference on whether injected fields are inherited or not so I figure weld-junit should follow the same rules with @EnableAutoWeld mode as well.
My guess is that there was an error in ClassScanning's method formerly named findAnnotatedFields and now renamed to findAnnotatedDeclaredFields having called getDeclaredFields which excludes inherited fields but the name of that method formerly named findAnnotatedFields did not reflect this restriction and was missed where it is used in scanForRequiredBeanClasses.
Producers, however, are not inherited, see https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#member_level_inheritance.
The text was updated successfully, but these errors were encountered: