Description
With a @Dependent producer method retrieving the InjectionPoint instance in case of a programmatic lookup, the method InjectionPoint.getQualifiers does not return the subset of qualifiers specified in during the lookup with Instance.select.
The following test case:
@RunWith(Arquillian.class) public class OwbTest { @Deployment public static Archive<?> deployment() { return ShrinkWrap.create(JavaArchive.class) // Test class .addClass(Beans.class) // Bean archive deployment descriptor .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Any @Inject Instance<String> strings; @Test public void test() { System.out.println(strings.select(new AnnotationLiteral<MyQualifier>() { }).get()); } } class Beans { @Produces @MyQualifier String producer(InjectionPoint ip) { return Objects.toString(ip.getQualifiers()); } } @Qualifier @Retention(RetentionPolicy.RUNTIME) @interface MyQualifier { }
Outputs:
[@javax.enterprise.inject.Any()]
While it would be expected to outputs:
[@MyQualifier(), @javax.enterprise.inject.Any()]
Attachments
Issue Links
- relates to
-
OWB-1155 InjectionPoint.getQualifiers does not return the list of selected qualifiers with type and qualifiers programmatic lookup
- Open