title: Spring @Autowired field is null when running Mockito test
body: <p>This is my main code:</p>
  
  <pre><code>@Service
  public class MainService {
      public String mainMethod() {
          SomeService someService = new SomeService("required");
          // do Sth.
      }
  }
  
  @Service
  @RequiredArgsConstructor
  public class SomeService {
      @Autowired
      private SomeOtherService someOtherService;
      @Notnull
      private final String requiredField;
      // ...
  }
  
  @Service
  public class SomeOtherService {
      // just a bunch of public methods that might as well be static
  }
  </code></pre>
  
  <p>And this is the test setup:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  public class MainServiceTest {
      @InjectMocks
      private MainService mainService;
  
      @Test
      public void givenSth_whenSth_doSth() {
          // test mainService.mainMethod();
      }
  }
  </code></pre>
  
  <p>Can you please tell me why someOtherService inside SomeService is null?</p>
  
  <p>I figured out when yo use Spring's injection, you should not use manual instantiation (new ...) at the same time; so maybe <code>new SomeService("required")</code> is the problem? But then how do I inject field variables into SomeService if not by constructor call? I don't want to use the Builder because requiredField is supposed to be NotNull.</p>