title: Elasticsearch Spring boot integration test
body: <p>I am looking for the way to add embedded elasticsearch to my spring boot integration test. </p>
  
  <p>I looked at elastic search integration test but it does not work together with spring boot as both should uses different test runner.</p>
  
  <p>I have a class test as below unfortunately it does not work with error: </p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: No context information for thread:
    Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread
    running under a class
    com.carrotsearch.randomizedtesting.RandomizedRunner runner context?
    Add @RunWith(class
    com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your
    test class. Make sure your code accesses random contexts within
    @BeforeClass and @AfterClass boundary (for example, static test class
    initializers are not permitted to access random contexts).</p>
  </blockquote>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = App.class)
  @WebAppConfiguration
  @IntegrationTest("server.port:0")
  public class TestExample extends ElasticsearchIntegrationTest {
  
      TestRestTemplate testRestTemplate = new TestRestTemplate();
  
      @Value("${local.server.port}")
      int port;
  
      @Test
      public void testOne(){
          ResponseEntity&lt;String&gt; results = testRestTemplate.getForEntity(String.format("http://localhost:%d/client/1", port), String.class);
  
  
  
       System.out.print(results);
      }
  
  }
  </code></pre>
  
  <p>Does anybody has some ideas how to make them run or what is alternatives ??</p>