title: Spring boot unit test with h2 failing for schema
body: <p>I have sql file with insert statements like below</p>
  <blockquote>
  <p>insert into demo.course (col1, col2) VALUES( 'Val 1', 'KS1')</p>
  </blockquote>
  <p>My unit test</p>
  <pre><code>@ExtendWith(SpringExtension.class)
  @DataJpaTest
  @AutoConfigureTestDatabase //h2
  @ActiveProfiles(&quot;test&quot;)
  class TopicRepositoryTest extends BaseRepositoryTest {
  
      @Test
      public void newTopicCreationShouldBePossible() {        
          Topics newTopic = createTopics(&quot;STEAM&quot;); //from base
          assertNotNull(newTopic.getId());
      }
  }
  </code></pre>
  <p>Application-test.props</p>
  <blockquote>
  <p>spring.datasource.url=jdbc:h2:mem:testdb;IGNORECASE=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_UPPER=false</p>
  <p>spring.jpa.properties.hibernate.default_schema=DEMO</p>
  <p>spring.datasource.hikari.schema=DEMO</p>
  </blockquote>
  <p>Error:</p>
  <blockquote>
  <p>Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name 'entityManagerFactory' defined in class
  path resource
  [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]:
  Initialization of bean failed; nested exception is
  org.springframework.jdbc.datasource.init.ScriptStatementFailedException:
  Failed to execute SQL script statement #1 of class path resource
  [maria/importcommon.sql]: insert into demo.mytable (col1, col2)
  VALUES( 'Val 1', 'KS1'); nested exception is
  org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema &quot;DEMO&quot; not found; SQL
  statement:</p>
  </blockquote>
  <p>Reading some posts , I added the below, but it is not working</p>
  <blockquote>
  <p>spring.jpa.properties.hibernate.default_schema=DEMO</p>
  <p>spring.datasource.hikari.schema=DEMO</p>
  </blockquote>
  <p>How can I fix this issue and pass my tests?</p>