How are you doing integration tests with your datastore?
So what is the solution? There is a very neat solution based on containers: TestContainers. From your tests you can start a lightweight, throwaway instance of your datastore and this talk will walk you through on how to do that as well as alternatives with docker-maven-plugin.
Demoing multiple approaches of integration tests with Elasticsearch