allegro / embedded-elasticsearch

Tool that ease up creation of integration tests with Elasticsearch
Apache License 2.0
269 stars 81 forks source link

When running on a system with recent JDK set to default, elasticsearch won't start #70

Closed madmuffin1 closed 5 years ago

madmuffin1 commented 6 years ago

I have this Java 8 application which has a couple of Tests using the embedded elasticserch. But, on my computer Java 11 is set to be the default.

When starting the tests, the elasticsearch startup script will fall back to the systems default, without giving me a chance to change this behavior.

Unfortunately, the elasticsearch version I need to test against is NOT compatible with Java 11, and I don't want to change my systems default behavior.

I suggest adding a configuration parameter to the builder in EmbeddedElastic, say jreHomeToUse with the option to have it auto-set to the version of the running tests, not setting at all (and using system default) or setting to an explicit path.