Package org.jdbi.v3.testing.junit5
Class JdbiFlywayMigration
java.lang.Object
org.jdbi.v3.testing.junit5.JdbiFlywayMigration
- All Implemented Interfaces:
- JdbiExtensionInitializer
Use 
Flyway to create a database schema and/or preload a database instance.- 
Method SummaryModifier and TypeMethodDescriptionWill drop all objects in the configured schemas using Flyway after the test finishes.voidcleanup(DataSource ds, Handle handle) Run cleanup code after a test.static JdbiFlywayMigrationReturns an instance ofJdbiFlywayMigrationwhich can be configured and used as aJdbiExtensionInitializer.voidinitialize(DataSource ds, Handle handle) Run initialization code before a test.Use Defaultdb/migrationFlyway schema migration location.Add a custom flyway migration path.Add custom flyway migration paths.withSchema(String schema) Add flyway migration schema.withSchemas(String... moreSchemas) Add flyway migration schemas.
- 
Method Details- 
flywayMigrationReturns an instance ofJdbiFlywayMigrationwhich can be configured and used as aJdbiExtensionInitializer.@RegisterExtension public JdbiExtension extension = JdbiExtension.h2() .withInitializer(JdbiFlywayMigration.flywayMigration().withDefaultPath());- Returns:
- A JdbiFlywayMigrationinstance.
 
- 
withDefaultPathUse Defaultdb/migrationFlyway schema migration location. Migration scripts must be on the classpath.- Returns:
- The instance itself for chaining method calls.
 
- 
withPathAdd a custom flyway migration path.- Parameters:
- migrationPath- The path to add. Must not be null.
- Returns:
- The instance itself for chaining method calls.
 
- 
withPathsAdd custom flyway migration paths.- Parameters:
- migrationPaths- One or more paths to add. Must not be null.
- Returns:
- The instance itself for chaining method calls.
 
- 
withSchemaAdd flyway migration schema.- Parameters:
- schema- A schema to add. Must not be null.
- Returns:
- The instance itself for chaining method calls.
 
- 
withSchemasAdd flyway migration schemas.- Parameters:
- moreSchemas- One or more schemas to add. Must not be null.
- Returns:
- The instance itself for chaining method calls.
 
- 
cleanAfterWill drop all objects in the configured schemas using Flyway after the test finishes.- Returns:
- The instance itself for chaining method calls.
 
- 
initializeDescription copied from interface:JdbiExtensionInitializerRun initialization code before a test.- Specified by:
- initializein interface- JdbiExtensionInitializer
- Parameters:
- ds- A reference to the managed- DataSourcewhich is controlled by a- JdbiExtension.
- handle- The shared- Handlewhich is returned from- JdbiExtension.getSharedHandle().
- See Also:
 
- 
cleanupDescription copied from interface:JdbiExtensionInitializerRun cleanup code after a test.- Specified by:
- cleanupin interface- JdbiExtensionInitializer
- Parameters:
- ds- A reference to the managed- DataSourcewhich is controlled by a- JdbiExtension.
- handle- The shared- Handlewhich is returned from- JdbiExtension.getSharedHandle().
 
 
-