title: BeanCreationNotAllowedException after junit test in spring-boot project
body: <p>I got a Spring Boot project.<br>
  It can be startup successfully.<br>
  I added a test like this:  </p>
  
  <pre><code>@WebAppConfiguration
  @RunWith(SpringJUnit4ClassRunner.class)
  @SpringBootTest(classes = SopStart.class, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
  public class Test{
      @Test
      public void test(){
          System.out.println("success!");
      }
  }
  </code></pre>
  
  <p>The "success!" can be printed successfully. But at last I got an exception:  </p>
  
  <pre><code>2017-10-25 17:00:42.481  INFO [bootstrap,,,] 7280 --- [      Thread-15] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@758d0555: startup date [Wed Oct 25 17:00:09 CST 2017]; parent: org.springframework.web.context.support.GenericWebApplicationContext@75d4a80f
  2017-10-25 17:00:42.492  WARN [bootstrap,,,] 7280 --- [      Thread-15] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent
  
  org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaAutoServiceRegistration': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:216)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      ...
  </code></pre>