# Integration java testing

**URL:** <https://discuss.elastic.co/t/integration-java-testing/79237>\
**Category:** Elasticsearch\
**Created:** [March 20, 2017, 11:27am UTC](https://discuss.elastic.co/t/integration-java-testing/79237 "2017-03-20T11:27:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maarten\_Vandermeiren](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Maarten\_Vandermeiren](https://discuss.elastic.co/u/Maarten_Vandermeiren)\
**Post date:** [March 20, 2017, 11:27am UTC](https://discuss.elastic.co/t/integration-java-testing/79237/1 "2017-03-20T11:27:55Z")

</div>

I have a spring MVC web application.  
Recently I started the migration of ElasticSearch 2.4 to 5.2 but I'm having problems with my Integration Tests in my application.

With Elastic 2.4 I used an embedded elasticsearch for my tests, but that's not possible anymore I guess.

So I tried to extends the ESIntegTestCase but that gave a lot of issues (JarHell, Security issues,...).

Another approach, make e ElasticSearch Client in my test spring config. (Like I did earlier with the 2.4).  
But creating my own settings, node & client. It forces my to run my tests with the RandomizedRunner.class.  
Problem there, my test-spring context won't boot anymore.  
Is there a way to use the : SpringJUnit4ClassRunner.class instead of the RandomizedRunner.class AND create your own node / client?

Thanks!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 20, 2017, 2:20pm UTC](https://discuss.elastic.co/t/integration-java-testing/79237/2 "2017-03-20T14:20:31Z")

</div>

IT should be done using an external node. Read [https://www.elastic.co/blog/elasticsearch-the-server](https://www.elastic.co/blog/elasticsearch-the-server)

I advice looking:

- [https://github.com/alexcojocaru/elasticsearch-maven-plugin](https://github.com/alexcojocaru/elasticsearch-maven-plugin) if you are a maven user
- [http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/](http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/) if you are a maven user (but another way to do it)
- [https://www.elastic.co/guide/en/elasticsearch/reference/current/integration-tests.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/integration-tests.html) might help as well

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 17, 2017, 2:20pm UTC](https://discuss.elastic.co/t/integration-java-testing/79237/3 "2017-04-17T14:20:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
