title: Testing custom validators with injectionpoints, WeldUnit is not injecting the hibernate bean validation factory
body: <p>I'm trying to make a very simple testcase testing a custom validator in hibernate bean validation. The custom validator has an injection point.</p>
  <p>Junit4, BeanValidation 6.1.5.Final, WeldUnit 2.0.0.Final</p>
  <pre class="lang-java prettyprint-override"><code>public class AssertCrsForOffshoreTest extends TestBase {
  
      //CHECKSTYLE:OFF
      @Rule
  //    public WeldInitiator weld = WeldInitiator.from( ValidatorFactory.class ).inject( this ).build();
      public WeldInitiator weld = WeldInitiator.from( ValidatorFactory.class ).build();
      //CHECKSTYLE:ON
      
      @Test
      public void testValidCrs() {
  
          // prepare test
          BroLocation location = createLocation();
          location.setCrs( BroConstants.CRS_WGS84 );
          BeanWithLocation bean = new BeanWithLocation(  location );
  
          // action
          Set&lt;ConstraintViolation&lt;BeanWithLocation&gt;&gt; violations = weld.select( ValidatorFactory.class ).get().getValidator().validate( bean );
  
          // verify
          assertThat( violations ).isEmpty();
      }
  
  
  }
  </code></pre>
  <p>However, for some reason it cannot resolve the injection point: <code>org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001334: Unsatisfied dependencies for type ValidatorFactory with qualifiers</code>. I guess I need to refer to an implementation rather than the <code>ValidatorFactory.class</code>.</p>