title: @DataJpaTest fails when using Eureka / Feign
body: <p>I have the the following Spring Boot application (using Eureka and Feign):</p>
  
  <pre><code>@SpringBootApplication
  @EnableFeignClients
  @EnableRabbit
  @EnableDiscoveryClient
  @EnableTransactionManagement(proxyTargetClass = true)
  public class EventServiceApplication {
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(EventServiceApplication.class, args);
      }
  }
  </code></pre>
  
  <p>and the following test, annotated with @SpringJpaTest:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @DataJpaTest(showSql = true)
  public class EventRepositoryTest {
  
      @Autowired
      private TestEntityManager entityManager;
  
      @Autowired
      private EventRepository repository;
  
      @Test
      public void testPersist() {
          this.entityManager.persist(new PhoneCall());
          List&lt;Event&gt; list = this.repository.findAll();
  
          assertEquals(1, list.size());
      }
  }
  </code></pre>
  
  <p>While running the test I receive the following error:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.netflix.discovery.EurekaClient] found for dependency [com.netflix.discovery.EurekaClient]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
  </code></pre>
  
  <p>Full stacktrace <a href="http://pastebin.com/upfyee0u" rel="nofollow">here</a></p>
  
  <p>Is there a way to solve this issue? I've seen that it is caused by @EnableFeignClients and @EnableDiscoveryClient annotations.</p>