tlrx / elasticsearch-test

elasticsearch-test, a framework that makes elasticsearch unit testing a breeze.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

client() on LocalClientProvider does not instantiate a Node

richtmat opened this issue · comments

I'm using elasticsearch-test in the context of CDI and in my tests I want to inject the client into my beans. I wrote a @produces method which calls esSetup.client(). My problem is that client() does not call open() to start a node. Is that intended behaviour?

In my fork I'm calling open() in client() - I can prepare a PR if you like..

Hi,

When using CDI frameworks, consider using https://github.com/tlrx/elasticsearch-test/blob/master/src/main/java/com/github/tlrx/elasticsearch/test/provider/DefaultClientProvider.java instead of LocalClientProvider. Thus you'll be able to use your own Client instance.