title: How to extend @Service?
body: <p>Here is a sample class below:</p>
  <pre><code>@Service(&quot;testService&quot;)
  public class TestService {
      public String something() {
          return &quot;abc&quot;;
      }
  }
  </code></pre>
  <p>I want to extend the class and let the container know that it needs to pick up my extended class from now.</p>
  <pre><code>@Service(&quot;extendedTestService&quot;)
  public class ExtendedTestServiceMock extends TestService { 
      @Override
      public String something() {
          return &quot;xyz&quot;;
      }
  }
  </code></pre>
  <p>Test class:</p>
  <pre><code>public class TestClass extends SpringTest {
      @Autowired
      @Qualifier(&quot;extendedTestService&quot;)
      private ExtendedTestService testService;
  
      public void testMethod() {
          ......
      }
  
  }
  </code></pre>
  <pre><code>Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [TestService] is defined: expected single matching bean but found 2: ExtendedTestServiceMock,testService 
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:865) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      ... 91 common frames omitted
  </code></pre>
  <p>How to resolve it?</p>