title: How to write unit tests in spring boot for elasticsearch
body: <p>I have to write unit tests of spring boot application with elasticsearch.</p>
  
  <p>I've read a lot of documentation, and I've discovered that an embedded elasticsearch can be used, a bit like using H2 for DBMS.</p>
  
  <p>Unfortunately, applying what I read and looking at some examples found on the net, I came to the conclusion that an embedded elasticsearch cannot be used for my purpose, or I don't know how to make it work.</p>
  
  <p>Has anyone ever used an embedded elasticsearch to make me understand how he used it?</p>