title: Could not autowire JobLauncherTestUtils
body: <p>I am attempting to test a simple spring batch application.</p>
  
  <p>Using the Spring Batch documentation as a guide (<a href="https://docs.spring.io/spring-batch/docs/current/reference/html/testing.html#endToEndTesting" rel="nofollow noreferrer">found here</a>), I have created the following test class:</p>
  
  <pre><code>import org.junit.runner.RunWith;
  import org.springframework.batch.test.JobLauncherTestUtils;
  import org.springframework.batch.test.context.SpringBatchTest;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.test.context.ContextConfiguration;
  import org.springframework.test.context.junit4.SpringRunner;
  
  import static org.junit.jupiter.api.Assertions.assertNotNull;
  
  @SpringBatchTest
  @RunWith(SpringRunner.class)
  @ContextConfiguration(classes = BatchConfig.class)
  class BatchConfigTest {
      @Autowired
      private JobLauncherTestUtils jobLauncherTestUtils;
  
      @Test
      void userStep() {
          assertNotNull(jobLauncherTestUtils, "jobLauncherTestUtils should not be null");
      }
  }
  </code></pre>
  
  <p>According to docs <code>@SpringBatchTest</code> should inject the <code>JobLaucherTestUtils</code> bean. However, when I run the test, the assertion fails. I have also tried defining the bean in an inner configuration class and had the same result:</p>
  
  <pre><code>    static class TestConfiguration {
          @Autowired
          @Qualifier("userJob")
          private Job userJob;
  
          @Bean
          public JobLauncherTestUtils jobLauncherTestUtils() {
              JobLauncherTestUtils utils = new JobLauncherTestUtils();
              utils.setJob(userJob);
              return utils;
          }
      }
  </code></pre>
  
  <p>Is there something I'm missing? The full source code can be found <a href="https://github.com/matthewgreene/spring-batch-demo/tree/master" rel="nofollow noreferrer">here</a>.</p>