use of org.flywaydb.core.internal.util.Locations in project flyway by flyway.
the class CompositeMigrationResolverSmallTest method skipDefaultResolvers.
@Test
public void skipDefaultResolvers() {
FlywayConfigurationForTests config = FlywayConfigurationForTests.create();
config.setSkipDefaultResolvers(true);
MigrationResolver migrationResolver = new CompositeMigrationResolver(null, new Scanner(Thread.currentThread().getContextClassLoader()), config, new Locations("migration/outoforder", "org/flywaydb/core/internal/resolver/jdbc/dummy"), PlaceholderReplacer.NO_PLACEHOLDERS);
Collection<ResolvedMigration> migrations = migrationResolver.resolveMigrations();
assertTrue(migrations.isEmpty());
}
use of org.flywaydb.core.internal.util.Locations in project flyway by flyway.
the class CompositeMigrationResolverSmallTest method resolveMigrationsMultipleLocations.
@Test
public void resolveMigrationsMultipleLocations() {
FlywayConfigurationForTests config = FlywayConfigurationForTests.create();
PlaceholderReplacer placeholderReplacer = new PlaceholderReplacer(new HashMap<String, String>(), "${", "}");
MigrationResolver migrationResolver = new CompositeMigrationResolver(null, new Scanner(Thread.currentThread().getContextClassLoader()), config, new Locations("migration/subdir/dir2", "migration.outoforder", "migration/subdir/dir1"), placeholderReplacer, new MyCustomMigrationResolver());
Collection<ResolvedMigration> migrations = migrationResolver.resolveMigrations();
List<ResolvedMigration> migrationList = new ArrayList<ResolvedMigration>(migrations);
assertEquals(4, migrations.size());
assertEquals("First", migrationList.get(0).getDescription());
assertEquals("Late arrivals", migrationList.get(1).getDescription());
assertEquals("Virtual Migration", migrationList.get(2).getDescription());
assertEquals("Add foreign key", migrationList.get(3).getDescription());
}
Aggregations