0

I am upgrading my springboot from 2.2 to 2.6. As part of this upgrade, when I am testing JUNITs using inMemory H2 database, all tests started failing with missing data despite having data.sql. I reviewed spring docs and made following changes in my application.yml file.

spring.sql.init.mode: always
spring.jpa.defer-datasource-initialization: true
spring.jpa.generated-ddl: true # tried this option without hibernate one too
spring.jpoa.hibernate.ddl-auto: create-drop #tried this option alone too along with changing to create


    

Despite using above options, I dont see my data.sql data visible in test cases and all my test cases started to fail.Did anyone encounter similar issue? If so, what would be possible resolution?

Sasi
  • 29
  • 3

1 Answers1

0

You just need to change your data.sql to import.sql

Rodrigo
  • 37
  • 5