title: How to use @InjectMocks along with @Autowired annotation in Junit
body: <p>I have a class A which is using 3 differnt classes with autowiring </p>
  
  <pre><code>public class A () {
  
      @Autowired
      private B b;
  
      @Autowired
      private C c;
  
      @Autowired
      private D d;
  }
  </code></pre>
  
  <p>While testing them, i would like to have only 2 of the classes (B &amp; C) as mocks and have class D to be Autowired as normal running, this code is not working for me:</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class aTest () {
  
      @InjectMocks
      private A a;
  
      @Mock
      private B b;
  
      @Mock
      private C c;
  
      @Autowired
      private D d;
  }
  </code></pre>
  
  <p>Is it even possible to do so?</p>