-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.1.11.Final
-
None
The CDIInjectionEnricher should only inject method parameters annotated with @Inject, as is the spec and as it does with instance variables.
The current implementation, which treats every method parameter as an injection point, conflicts with custom test enrichers. If my project is a beanarchive with bean-discovery-mode=all then every class is counted as a bean.
If I have a testmethod where a custom enricher supplies one of the parameters the CDIInjectionEnricher also provides that parameter but by calling it's default parameter and not setting any other configuration, resulting in faulty testdata.
Even worse, because the ordering of TestEnrichers as used in LocalTestExecutor#enrichArguments is not defined, sometimes the bean provided by the custom enricher will be used, and sometimes the one provided by CDIInjectionEnricher, leading to a testcase that will only fail sometimes.