No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 181 commits behind flyway:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Test extensions for the Flyway project

For feature of Flyway see Flyway Db Org Page

Version 2.2.1 Released

2013-09-12 flyway-test-extensions version 2.2.1 released.

Version number 2.2.1 are used to show the dependency to Flyway version 2.2.1.

See also Release Notes

Central maven repository under|ga|1|flyway-test-extensions contains all projects jar.


This extension give the possibility to reset and/or fill the database with defined content.
With this precondition each test had reproducible database start point.

  • Annotation support FlywayTest for database unit testing. Use Flyway feature.
    • clean - execution of flyway task clean
    • init - execution of flyway task init
    • migrate - execution of flyway task migrate
  • Annotation can be used at
    • each test class (once per test case)
    • each test method
  • Samples projects to use annotation inside a unit testing environment
  • Additional project supports a DBUnit annotation use together with FlywayTest DBUnitSupport. A usage example you will find at UsageFlywayDBUnitTest.

How to use it

The flyway test extension are available at Maven Central.

For a detail usage description see the UsageFlywaySpringTest usage page.

  • add dependency to flyway-spring-test to your Mavan pom file
  • Extend your test class with the Spring test runner annotation.
    @ContextConfiguration(locations = {"/context/simple_applicationContext.xml" })
    @TestExecutionListeners({DependencyInjectionTestExecutionListener.class, FlywayTestExecutionListener.class })
  • add the @FlywayTest annotation on each class or method were you need a clean database
    public class Spring3JUnitTest 

Project depend on


  • The project depends on flyway version 2.2.1
  • The project will be supported until the extension will be integrated into the flyway project.
  • The project depends on Spring version 3.1
    • All features works with Spring version 3.x
    • It works also with Spring version 2.5.6, but you can not use all features. A example project show how to use it with Spring 2.5.6
  • At the moment the code is tested with database H2 and Oracle.
    Only the DBunit part contains database specific code.