1 Reply Latest reply on Dec 27, 2009 4:23 PM by Gavin King

    Unit testing and qualifiers (bindings)

    Johan Eltes Newbie

      I've spent some time figuring out how to do out-of-container unit testing of weld beans with JUnit. I came across org.jboss.weld.test:weld-test-junit:jar:1.0.0-SNAPSHOT, that I built from http://anonsvn.jboss.org/repos/weld/test/trunk.

      Test cases will then have their dependencies resolved by the weld se container. There is something I can't get my head around: It seems there have to be an explicit qualifier annotation for a dependency to be resolved.

      This works (dependency is resolved):

      @Default private MyClass myClass;

      While this doesn't (dependency isn't resolved):

      @Inject private MyClass myClass;

      Any insights into this would be appreciated. Thanks.