title: Accessing H2 Console While Running SpringBootTest
body: <p>If I'm running a test with <code>@SpringBootTest</code> is there any way to access the H2 console?  I have a test that accesses an H2 database (successfully), but if I want to inspect the database myself, how can I?</p>
  
  <p>I started by running the test with a <code>webEnvironment=DEFINED_PORT</code> and <a href="http://localhost:8080/" rel="noreferrer">http://localhost:8080/</a> responds to HTTP, but there's nothing <a href="http://localhost:8080/h2-console/" rel="noreferrer">http://localhost:8080/h2-console/</a> still responds with 404.</p>
  
  <p>I tried turning on the console explicitly by adding values to <code>application.properties</code>:</p>
  
  <pre><code>spring.h2.console.enabled=true
  spring.h2.console.path=/h2
  </code></pre>
  
  <p>That seemed to have no effect. Still 404s at <code>/h2-console</code> and <code>/h2</code>. </p>
  
  <p>The H2 Console seems to come in through Auto-Configuration, so I turned on the auto configuration report using <code>-Ddebug</code>, and I can see that despite the enabled flag being on in application.properties, it's seen as being off:</p>
  
  <pre><code>H2ConsoleAutoConfiguration: 
        Did not match:
            - @ConditionalOnProperty (spring.h2.console.enabled=true) did not find property 'enabled' (OnPropertyCondition)
        Matched:
           - @ConditionalOnClass found required class 'org.h2.server.web.WebServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
           - found WebApplicationContext (OnWebApplicationCondition)
  </code></pre>
  
  <p>Seems like some mechanism is overriding the value or ignoring the value from <code>application.properties</code> while running the test.</p>
  
  <p>Does Spring Boot Test not start up the console? Is there any way to convince it to do so?</p>