How are you doing integration tests with your datastore?
So what is the solution? There are some very neat solutions based on containers, namely the Docker-Maven-Plugin and TestContainers. From your tests you can start a lightweight, throwaway instance of your datastore and this talk will walk you through how to do that.
Demoing multiple approaches of integration tests with Elasticsearch.