# Is the HighLevelRestClient no supported in the Java Testing Framework?

**URL:** <https://discuss.elastic.co/t/is-the-highlevelrestclient-no-supported-in-the-java-testing-framework/218083>\
**Category:** Elasticsearch\
**Created:** [February 6, 2020, 4:52am UTC](https://discuss.elastic.co/t/is-the-highlevelrestclient-no-supported-in-the-java-testing-framework/218083 "2020-02-06T04:52:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 6, 2020, 5:12am UTC](https://discuss.elastic.co/t/is-the-highlevelrestclient-no-supported-in-the-java-testing-framework/218083/2 "2020-02-06T05:12:40Z")

</div>

Hi @dg1,

the problem with running high level rest client tests against the single node created by `ESSingleNodeTest` isn't so much that the HLRC doesn't work in tests per se but rather that the single node started, is started without a HTTP layer. If you really want it to start up the HTTP layer as well, you'll need to override the plugins that are loaded for that node to include the Netty 4 transport and also disable the mock http layer.

The latte you can do by adding:

```auto
    @Override
    protected boolean addMockHttpTransport() {
        return false; // enable http
    }

```

to your test class as is done here for example (those tests use low level rest client, but HLRC will work just the same): [https://github.com/elastic/elasticsearch/blob/master/modules/transport-netty4/src/test/java/org/elasticsearch/rest/discovery/Zen2RestApiIT.java](https://github.com/elastic/elasticsearch/blob/master/modules/transport-netty4/src/test/java/org/elasticsearch/rest/discovery/Zen2RestApiIT.java)

The Netty 4 plugin you can load by adding:

```auto
    @Override
    protected Collection<Class<? extends Plugin>> nodePlugins() {
        return Collections.singletonList(Netty4Plugin.class);
    }

```

as is done in e.g. our Netty ITs here [https://github.com/elastic/elasticsearch/blob/master/modules/transport-netty4/src/test/java/org/elasticsearch/ESNetty4IntegTestCase.java#L57](https://github.com/elastic/elasticsearch/blob/master/modules/transport-netty4/src/test/java/org/elasticsearch/ESNetty4IntegTestCase.java#L57)

Provided the dependencies are set up correctly (i.e. you have the Netty 4 transport dependency on your test class path), this should work fine (it does in some of our own tests in the linked examples).

---

_[View the full topic](https://discuss.elastic.co/t/is-the-highlevelrestclient-no-supported-in-the-java-testing-framework/218083)._
