Unit testing elasticsearch in Java

I am using Elasticsearch 5.6.7. I am new to elasticsearch testing and was curious to know if I could unit test my dao classes without running an elasticsearch in my system.
Was unable to find any detailed information on how to use ESTestCase class to unit test the dao classes.
It would be very helpful if provided with some sample tests.

I believe that you need to mock the elasticsearch client may be? Not sure what you want to unit test in a Dao.

I wanted to check if RestHighLevelClient object is returning required output.

So you want to check the RestHighLevelClient itself? Not your code?
I don't think that's what you should do.

May you should look instead at doing integration tests?

Then how can I use ESTestCase class for unit testing.

ESTestCase is meant to be used to test Elasticsearch itself I think, from Elasticsearch repository.
Not your integration with Elasticsearch.

Ok. Now I have a clear picture.
Thank you very much.

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