I have just (attempted) to create a junit+arquillian test for this (but arquillian is having some problems in relation to dependency setup) NOTE: I have tried to simplify the example... if you submit "Marco" to the producer, it should return "Polo" and vice-a-versa https://github.com/ahhughes/cdi-programmatic-lookup-with-runtime-qualifier-value-test
What versions are you using? This should work.
Thanks Pete, very important to know that this should work the version I am currently using is 1.1.5.FINAL
(need to fix arquilian profile in my test, but this confirms 1.1.5.FINAL https://github.com/ahhughes/cdi-programmatic-lookup-with-runtime-qualifier-value-test/blob/master/pom.xml#L13)
THANKS SO FAR, seems promising
This is wrong. You cannot expect the annotation to be reflected within the low-level representation of the Instance-injected field (AnnotatedField). You should be able to get the information you want using InjectionPoint.getQualifiers().
Thanks very much Jozef, you are correct this does work! Once I have arquillian working properly I can proove it on github
Use... injectionPoint.getQualifiers() not injectionPoint.getAnnotated()
Thanks very much, without your help I was about to give up!