i use liquibase set database schema. disable hibernate create anything. because of that, import.sql ignored. there way configure spring boot or liquibase or other part load test data after liquibase has created tables?
if need crude (i.e, not actual data migrations), can use spring's jdbc initializer in spring boot. in nutshell, you'll need to:
- create
data-test.sqlload data, , place insrc/main/resourcesdirectory. different environments, use naming conventiondata-{platform}.sql - add
applications-test.propertiessrc/main/resourcesfollowing:spring.datasource.platform=test # actives data-test.sql above spring.datasource.continueonerror=???? # depends on needs - to active
application-test.propertiesduring testing, make sure "test" 1 of profiles that's active during integration test. 1 way annotate test class@activeprofiles({"test", ...}).
Comments
Post a Comment