How to run liquibase before running tests.


Liquibase runs when I run the application but it don’t run while I run the tests, I want to execute the database migrations before the execution of the integration test, how I can do this, can any one help me?



How are you running your integration tests?  You can call liquibase via command line or even using the liquibase.Liquibase object directly as part of your integration test execution script.


I’m working in grails and running the test with command ‘grails test-app’, and I’m not using the grails plugin for liquibase, for application I use the liquibase’s action listener which do not work with integration tests. how can I run the liquibase migrations while running the integration tests?

I haven’t used grails enough to know.  Does anyone who uses grails have an idea?  Otherwise, it may be a question for the grails list.  There is a java api to liquibase in the class liquibase.Liquibase, otherwise you may be able to use the grails migrations plugin just in your test-app target.