You have a spring boot application with flyway migration scripts for a MySQL database. Now your tests are failing because you don’t have the database available during unit testing and flyway is complaining.
Use an in memory H2 database in MySql mode.
- Create a file called
src/test/resourceswith the following content
- create an
src/test/resourceswith the following flyway config:
- Add a test dependency on h2 to the
- Have fun.