# How to create integration test cases for elastic search application using RestHighLevelClient and embedded elastic search

**URL:** <https://discuss.elastic.co/t/how-to-create-integration-test-cases-for-elastic-search-application-using-resthighlevelclient-and-embedded-elastic-search/163844>\
**Category:** Elasticsearch\
**Created:** [January 11, 2019, 6:00am UTC](https://discuss.elastic.co/t/how-to-create-integration-test-cases-for-elastic-search-application-using-resthighlevelclient-and-embedded-elastic-search/163844 "2019-01-11T06:00:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganil.89](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@ganil.89](https://discuss.elastic.co/u/ganil.89)\
**Post date:** [January 11, 2019, 6:00am UTC](https://discuss.elastic.co/t/how-to-create-integration-test-cases-for-elastic-search-application-using-resthighlevelclient-and-embedded-elastic-search/163844/1 "2019-01-11T06:00:26Z")

</div>

Recently we have upgraded from Transport client to RestHighLevelClient, how to develop integration tests using RestHighLevelClient and embedded elastic search, since we want to test DAO layer as well.

Also please propose best solution which fits this scenario.

Thanks in Advance

---

<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:** [January 11, 2019, 7:11am UTC](https://discuss.elastic.co/t/how-to-create-integration-test-cases-for-elastic-search-application-using-resthighlevelclient-and-embedded-elastic-search/163844/2 "2019-01-11T07:11:07Z")

</div>

You can not run elasticsearch embedded. Read this [blog post](https://www.elastic.co/blog/elasticsearch-the-server).

Note that to run integration tests (not unit tests) you would probably prefer running that in something close to a production environment, like a real elasticsearch server instance. I shared some ideas about integration testing in this thread: [In memory testing with RestHighLevelClient](https://discuss.elastic.co/t/in-memory-testing-with-resthighlevelclient/106196/6)

Also this sample project shows how to use Elasticsearch Test Classes:

> **[joel-costigliola/elastic-search-test](https://github.com/joel-costigliola/elastic-search-test)**
>
> ESIntegTestCase example. Contribute to joel-costigliola/elastic-search-test development by creating an account on GitHub.

---

<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:** [February 8, 2019, 7:11am UTC](https://discuss.elastic.co/t/how-to-create-integration-test-cases-for-elastic-search-application-using-resthighlevelclient-and-embedded-elastic-search/163844/3 "2019-02-08T07:11:09Z")

</div>

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