title: How to access H2 console in Spring Boot 2.0 test that uses DataJpaTest
body: <p>When using @DataJpaTest, how can I configure the test class to run with the bits needed to handle http requests for the H2 console?</p>
  
  <p>I am running a Spring Boot 2.0 test that uses H2.  I want to set a breakpoint in a test and view the contents of a table in H2.  However, when the test stops at the breakpoint and I point my browser to <a href="http://localhost:8080/h2-console" rel="noreferrer">http://localhost:8080/h2-console</a>, the result is a blank page with the text "localhost didn’t send any data".  So it appears that either the test is running without the bits needed to handle the http request for the H2 console or the URL I'm using is wrong.  </p>
  
  <p>Note: when I run the test, the console indicates that the embedded H2 database is successfully started, so I'm confident H2 is actually running.</p>
  
  <p>Here are my test class annotations:</p>
  
  <p><code>@ExtendWith(SpringExtension.class)</code></p>
  
  <p><code>@DataJpaTest</code></p>
  
  <p><code>@TestInstance(TestInstance.Lifecycle.PER_CLASS)</code></p>
  
  <p>I read an article suggesting to include devtools in my pom, but that did not solve my problem.</p>
  
  <p><strong>Edit:</strong> The crux of my problem seems to be that I cannot figure out how to configure a test to include both an embedded test database and a running servlet. If I annotate the test class with both <code>@DataJpaTest</code> and <code>@SpringBootTest(webEnvironment = ...)</code>, the test crashes due to a missing ServletWebServerFactory bean. Removing <code>@DataJpaTest</code> fixes the missing bean problem, but I no longer have an embedded test database. Using only <code>@DataJpaTest</code> fails to start a servlet</p>