title: Spring Boot - Conditional Loading of Initial Data
body: <p>I have set up my Spring Boot application so that my H2 embedded database is populated at startup. I've done this by creating a data.sql file in the <code>src/main/resources</code> folder.</p>
  
  <p>What I don't understand is what causes this to run at startup. </p>
  
  <p>Also, I'd like to make this conditional - e.g. prevent it from executing when I'm running unit tests. Is this possible?</p>
  
  <p>A similar question was asked <a href="https://stackoverflow.com/q/51358189/820657">here</a>, but it is unresolved.</p>