httpretty might be used to fake an ElasticSearch instance. See e.g. https://forum.invenio-software.org/t/testing-tip-using-httpretty-to-test-external-services/35/last