title: Spring Boot 1.4 - TestRestTemplate Unsatisfied dependency exception
body: <p>Have a very light Spring Boot 1.4 project, generated from <a href="http://start.spring.io">start.spring.io</a>.</p>
  
  <p>Trying to run an intergration test for <code>@RestController</code> with <code>@RequestBody</code> using <code>TestRestTemplate</code>, but there's no success because of a startup exception.</p>
  
  <p>The only configuration class:</p>
  
  <pre><code>@SpringBootApplication
  public class Application {
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>Configuration file <code>application.properties</code> has almost nothing except of <code>security.ignored=/**</code> for the test purposes.</p>
  
  <p>The test class:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest
  @DataJpaTest
  public class MyControllerTest {
  
      private Logger log = Logger.getLogger(getClass());
  
      @Autowired
      private TestRestTemplate restTemplate;
  
      @Autowired
      private TestEntityManager entityManager;
  
      @Before
      public void init() {
  
          log.info("Initializing...");
      }
  
      @Test
      public void addTest() throws Exception {
  
          log.info("MyController add test starting...");
  
          // restTemplate usage
  
          log.info("MyController add test passed");
      }
  }
  </code></pre>
  
  <p>... but during the test startup I get the following exception:</p>
  
  <pre><code>ERROR 6504 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.boot.test.autoconfigure.AutoConfigureReportTestExecutionListener@5444f1c3] to prepare test instance [com.myproject.controllers.MyControllerTest@5d2bc446]
  
  org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.myproject.controllers.MyControllerTest': Unsatisfied dependency expressed through field 'restTemplate': No qualifying bean of type [org.springframework.boot.test.web.client.TestRestTemplate] found for dependency [org.springframework.boot.test.web.client.TestRestTemplate]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.boot.test.web.client.TestRestTemplate] found for dependency [org.springframework.boot.test.web.client.TestRestTemplate]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:569) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  </code></pre>
  
  <p>According to the <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html">doc</a> it's not required to configure <code>TestRestTemplate</code> anywhere. However, I've added the latest Apache Http Client to the classpath as it recommended.</p>
  
  <p>What have I missed?</p>