0

I wrote the migration using https://flywaydb.org/documentation/getstarted/advanced/java . Now I want to test this in test classes.

How is it possible to add old data -> perform migration in tests -> check that the data migrated correctly?

How else can I tell a test to perform a migration within a single test?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Ilya Y
  • 744
  • 6
  • 24
  • Does this answer your question? [How to test flyway migration?](https://stackoverflow.com/questions/23324952/how-to-test-flyway-migration) – crizzis Apr 05 '21 at 09:29
  • 1
    @crizzis obviously not, as the answer implies having a database locally – Boris Strandjev Apr 05 '21 at 11:57
  • In addition to the suggestions on that link, take advantage of the VALIDATE command and the ability to migrate only after a validation. – Grant Fritchey Apr 05 '21 at 11:57
  • As part of the test, how can I configure a configuration that will register in "locations" for flyway not only the standard "db/migrations" path, but also the path for my test migration? – Ilya Y Apr 05 '21 at 12:08

0 Answers0