title: No qualifying bean, expected single matching bean but found 2
body: <p>I searched on both the internet and on stack overlow but can't seem to find a solution to my problem:</p>
  
  <pre><code>Unable to find bean reference for type 'class com.consol.citrus.http.client.HttpClient'Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.consol.citrus.http.client.HttpClient' available: expected single matching bean but found 2: server1BasicAuthClient,server2BasicAuthClient
  </code></pre>
  
  <p>To sketch some background information: I have to make a small application using Spring 5 and Citrus Framework to automate our integration tests.</p>
  
  <p>I defined as following my Beans:</p>
  
  <pre><code>@Configuration 
  public class EndpointAuthentication {
  
  public String server1Host;
  
  public int server1Port;
  
  public String server2Host;
  
  public int server2Port;
  
  @Bean(name="server1BasicAuthClient")
  public com.consol.citrus.http.client.HttpClient server1BasicAuthClient() throws Exception {
      return CitrusEndpoints.http()
              .client()
              .requestUrl(String.format("http://%s:%s/", server1Host, server1Port))
              .requestFactory(sslRequestFactory(server1Host,server1Port))
              .build();
  }
  
  @Bean(name="server2BasicAuthClient")
  public com.consol.citrus.http.client.HttpClient server2BasicAuthClient() throws Exception {
      return CitrusEndpoints.http()
              .client()
              .requestUrl(String.format("http://%s:%s/", server2Host, server2Port))
              .requestFactory(sslRequestFactory(server2Host,server2Port))
              .build();
  }
  }
  </code></pre>
  
  <p>And I tried to inject my Bean like this,</p>
  
  <pre><code>public class AuthenticationIT {
  
  @Autowired
  @Qualifier("server1BasicAuthClient")
  @CitrusEndpoint
  private HttpClient server1BasicAuthClient;
  
  @Autowired
  @Qualifier("server2BasicAuthClient")
  @CitrusEndpoint
  private HttpClient server2BasicAuthClient;
  ....
  }
  </code></pre>
  
  <p>Any ideas where and how to fix the issue ?</p>
  
  <p>Thanks in advance.</p>