Testing rest clients in Java

I would like to add some basic tests into my Java app. I'm using es 5.6 with low & high level rest client. Essentially, at this early stage I would just like to create an index, add some documents & validate them. Having had a 1/2 hour scoot around the web I'm thinking the easiest thing to do is to just create an index on the local server (dev/test etc) and then tear it down at the end.

It strikes me that if there is a failure in the process I will leave some 'orphaned' mini indexes in place but I can probably live with that and maybe even write some code to list indexes and tidy the node at some later point (or just restore a clean node!).

Anyway I was just wondering if this is a reasonable approach or whether there is some kind of clever (in memory ?) process to do this off the main elasticSearch installation ? (Even better if someone has some code to help a simpleton onto the right track :wink: but really I'm mainly looking for guidance as to the approach I should take.


You can read:

Thanks and apologies for not finding that for myself, I kept getting results more pertinent to previous versions. Let me know if I should delete this post & immolate myself StackOverflow style :wink:

I had hard time TBH to find my own answer! :stuck_out_tongue:

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