How to build an embedded node in 5.x

I've used embedded Nodes for integration testing. Prior to 5.x, I could build a Node using the NodeBuilder. Now that builder is gone. How do I build an embedded node for testing?

Looking at, I am seeing:

        node = new Node(environment) {
            protected void validateNodeBeforeAcceptingRequests(
                final Settings settings,
                final BoundTransportAddress boundTransportAddress) throws NodeValidationException {
                BootstrapCheck.check(settings, boundTransportAddress);

Is this the way?

Running an embedded node isn't supported for anything, testing or otherwise. So you might be able to get it working now but it could fail on any release in the future. I suggest starting Elasticsearch before running integration tests in your build somehow.

Yes. Read this:

Here is how I solved that basically using some Maven/Ant vodoo:

You can also extend ESIntegTestCase as I described here: (see Add test infrastructure).



You could also consider the embedded node for integration tests:

Hope it helps!