I'm trying to connect to the "junit" embedded node in my code under test.
Normally the code under test makes a getNodeClient to 9300 to join the
cluster.
But I guess that's not an option with the embedded local(true) node.
So what is the answer?
One option is to write the original code (under test) to accept a client as
a parameter eg m(Client client, )
And that would work but would require significant refactoring of existing
code.
What do other people do?
Just to be clear, say I have a black box piece of code under test Class C
with method m()
I start up my unit test and create a node and create a client
Node node = nodeBuilder().local(true).node()
node.start()
client = node.client()
Now I call m()
and somewhere else m calls es.writeRecord()
which does a client = getClient() // get NodeClient
but the two servers are separate and distinct.
Any way around this other than as I suggest : refactoring all code
interfaces to pass in the client to be used?
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8cc197ba-68a9-4b93-9685-d652551b3731%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.