title: Test class with @Qualifier @Autowired value
body: <p>I'm testing a class that has <code>@Qualified @Autowired</code> value:</p>
  
  <pre><code>// class under test
  class C1() {
  
      @Autowired
      @Qualified("c1")
      DataSource d1;
      ...
  }
  </code></pre>
  
  <p>DataSource <code>d1</code> located in config file.</p>
  
  <p>But when I'm testing same class and I'm using separate <code>DataSource</code> which is in test config class:</p>
  
  <pre><code>// test for class
  @RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(classes = testC1Config.class, loader=AnnotationConfigContextLoader.class)
  class testC1() {
  
      @Autowired
      @Qualified("c1Test")
      DataSource d1Test;
      ...
  }
  
  // testC1Config
  @Configuration
  class testC1Config() {
  
      @Bean
      @Qualified("c1Test")
      DataSource c1Test() {
      ...
      }
  }
  
  </code></pre>
  
  <p>I get this exception:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=c1)}
  </code></pre>
  
  <p>says that he only sees DataSource Bean with only Qualifier <code>c1</code>. Have tried to use <code>@Bean(name=c1Test")</code> but I get same result..</p>
  
  <p>How do I make him to see the c1Test DataSource bean in test package?</p>