Annotation Interface FlywayTest


@Retention(RUNTIME) @Repeatable(FlywayTests.class) public @interface FlywayTest
Support for executing flyway commands during test without any special flyway command in test code.

The default behavior is to execute the flyway commands:
  • org.flywaydb.core.Flyway#clean()
  • org.flywaydb.core.Flyway#baseline()
  • org.flywaydb.core.Flyway#migrate()
For usage together with JUnit see org.flywaydb.test.junit.FlywayTestExecutionListener.

Version:
2011-12-10, 1.7
Author:
Florian
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Reference the flyway bean name.
    boolean
    invoke flyway command baseline before a migrate call
    boolean
    invoke flyway command clean before a init/migrate call.
    boolean
    invoke flyway command migrate
    Support to add locations to the default location settings.
    boolean
    With this attribute the handling of the locationsForMigrate can be changed.
  • Element Details

    • invokeCleanDB

      boolean invokeCleanDB
      invoke flyway command clean before a init/migrate call.

      If set to true it will invoke org.flywaydb.core.Flyway#clean(). Default: true
      Default:
      true
    • invokeBaselineDB

      boolean invokeBaselineDB
      invoke flyway command baseline before a migrate call

      Baseline will create the schema_version table with a initialization entry depending on org.flywaydb.core.Flyway configuration property org.flywaydb.core.Flyway#baselineVersion. It will invoke org.flywaydb.core.Flyway#baseline(). Default: false
      Default:
      false
    • invokeMigrateDB

      boolean invokeMigrateDB
      invoke flyway command migrate

      If set to true it will invoke org.flywaydb.core.Flyway#migrate(). Default: true
      Default:
      true
    • locationsForMigrate

      String[] locationsForMigrate
      Support to add locations to the default location settings.

      if overrideLocations() returns true the complete locations will be changed. Default: empty list

      Default:
      {}
    • overrideLocations

      boolean overrideLocations
      With this attribute the handling of the locationsForMigrate can be changed.

      Default: false

      Default:
      false
    • flywayName

      String flywayName
      Reference the flyway bean name.

      If no name are specified the first Flyway instance org.flywaydb.core.Flyway of the application context are used.

      If the name of the org.flywaydb.core.Flyway instance are not part of the application context, the test will fail with org.springframework.beans.factory.NoSuchBeanDefinitionException.

      Default: empty string

      Default:
      ""