Red Hat Bugzilla – Bug 980492
beans.xml in test classpath is not taken into account by JBDS
Last modified: 2016-10-31 21:37:00 EDT
Description of problem:
JBDS shows a warning for all injection points in Arquillian test classes:
"No bean is eligible for injection to the injection point [JSR-299 §5.2.1]"
The warning is shown even when there is beans.xml in src/test/resources and even for beans that reside in src/test/java or src/main/java.
Version-Release number of selected component (if applicable):
Import a project with CDI beans and an Arquillian test, e.g. the cdi-add-interceptor-binding quickstart.
The warning is shown for the field
@Inject TestableParameterLog testableParameterLog;
The warning doesn't make much sense since the bean will be injected into the test by Arquillian's enricher. Even though this is probably beyond the capability of the standard CDI validator in JBDS, an intelligent IDE could be expected to handle this.
A possible workaround is to add @SuppressWarnings("cdi-ambiguous-dependency") to the field or the class.
It seems the problem is somewhere else: JBDS doesn't care about beans.xml in src/test/resources.
Migrated to Jira
Rodney Russ <email@example.com> updated the status of jira WFK2-132 to Closed