Http.enabled with ESIntegTestCase


I'm new to writing elastic search plugin and I am still getting through the basics. I'd like to be able to test and debug my plugin from IDE. I rely on breakpoints and tracing the code to figure out what is going on.

I just realized that with ESIntegTestCase the mock cluster is not bound to http. I prefer to be able to interact with the server from the browser. I understand that this practice has been continued for good reasons and is not the default anymore. However, I'm wondering if it is possible to have http enabled anyhow. Thanks.

Here is the class I have

public class BasicPluginIntegrationTest extends ESIntegTestCase {
	private Client client;

	protected Collection<Class<? extends Plugin>> nodePlugins() {
		return Collections.singleton(BasicPlugin.class);

	protected Settings nodeSettings(int nodeOrdinal) {
		int randomPort = 9200; // randomIntBetween(49152, 65525);
		System.out.println("Hani " + NetworkModule.HTTP_ENABLED.getKey());
		Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal))
				.put(NetworkModule.HTTP_ENABLED.getKey(), true)
				.put(HttpTransportSettings.SETTING_HTTP_PORT.getKey(), randomPort).put("", "");
		Settings settings =;

		return settings;

	public void testLive() {
		System.out.println("Server live, hit enter to quit");
		(new Scanner(;



I am getting the following error

java.lang.IllegalStateException: Unsupported http.type []
	at org.elasticsearch.node.Node.<init>(
	at org.elasticsearch.node.MockNode.<init>(
	at org.elasticsearch.test.InternalTestCluster.buildNode(
	at org.elasticsearch.test.InternalTestCluster.reset(
	at org.elasticsearch.test.InternalTestCluster.beforeTest(
	at org.elasticsearch.test.ESIntegTestCase.beforeInternal(
	at org.elasticsearch.test.ESIntegTestCase.before(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(
	at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(
	at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(
	at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(
	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(
	at o...

(Ryan Ernst) #2

Enabling http requires having an http transport implementation. This is handled in elasticsearch in a module called transport-netty4, but modules are not added to the classpath of plugins. If you use the official gradle plugin for building your elasticsearch plugin, you automatically get a integTest task which you can write http based REST tests against, just like we test our official plugins.


I'm using Maven and I have netty4 as test task dependency. I guess the question is how to "run it" within the ESIntegTestCase. I got it to work by changing the BasicPlugin class to extend Netty4Plugin rather than Plugin, but then the plugin refused to work in the real elastic search server, presumably because netty4 was already enabled.



I just got it to work. It turns out I needed to have the two plugin in nodePlugins(). Thanks

protected Collection<Class<? extends Plugin>> nodePlugins() {
	Collection<Class<? extends Plugin>> al = new ArrayList<Class<? extends Plugin>>();
	return  al;

(system) #5

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