title: Test Spring with many threads
body: <p>I want to test my code against concurrency issues.
  I have a prototype bean:</p>
  <pre><code>@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
  public class MyBeanRunner {}
  </code></pre>
  <p>I have my thread class:</p>
  <pre><code>class MyJob extends Thread {
      @Autowired
      private MyBeanRunner jobRunner;
  
      @Override
      public void run() {...}
  }
  </code></pre>
  <p>Now I try to run it:</p>
  <pre><code>Future future = executorService.submit(new MyJob());
  </code></pre>
  <p>And jobRunner is null. How can I tell Spring to autowire MyBeanRunner inside MyJob?</p>