What is the recommended way to unit test components using RestHighLevelClient?

There is exact same request made few months back: RestHighLevelClient mocking

But it was auto closed without an explanation.

I tried using ESIntegTestCase and ran into endless slf4j, log4j incompatibility issues.

Being able to mock RestHighLevelClient will make testing easy,
Is there a better solution to test RestHighLevelClient now?

1 Like

Agree that at the very least the Rest Client should provide an Interface to allow unit tests to be mocked out.
On the other thread, it's pointed out that a really shallow layer of abstraction should be applied, but then one could not verify the interactions with the ES Client, making the layer of abstraction pretty much useless.

Adding an interface that fulfills Client or RestClient would be optimal for testing and extensibility.

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