use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class MigrationInfoHelperSmallTest method extractSchemaVersionWithLeadingZeroes.
/**
* Tests a schema version that includes a version with leading zeroes.
*/
@Test
public void extractSchemaVersionWithLeadingZeroes() {
Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription("009_4__EmailAxel", "", "__", "");
MigrationVersion version = info.getLeft();
String description = info.getRight();
assertEquals("009.4", version.toString());
assertEquals("EmailAxel", description);
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class MigrationInfoHelperSmallTest method extractSchemaVersionWithVUnderscorePrefix.
@Test
public void extractSchemaVersionWithVUnderscorePrefix() {
Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription("V_8_0__Description.sql", "V_", "__", ".sql");
MigrationVersion version = info.getLeft();
String description = info.getRight();
assertEquals("8.0", version.toString());
assertEquals("Description", description);
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class MigrationInfoHelperSmallTest method extractSchemaVersionWithDescription.
/**
* Tests a schema version that includes a description.
*/
@Test
public void extractSchemaVersionWithDescription() {
Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription("9_4__EmailAxel", "", "__", "");
MigrationVersion version = info.getLeft();
String description = info.getRight();
assertEquals("9.4", version.toString());
assertEquals("EmailAxel", description);
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class MigrationInfoHelperSmallTest method repeatableMigration.
@Test
public void repeatableMigration() {
Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription("R__EmailAxel.sql", "R", "__", ".sql");
MigrationVersion version = info.getLeft();
String description = info.getRight();
assertNull(version);
assertEquals("EmailAxel", description);
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class MigrationInfoHelperSmallTest method extractSchemaVersionWithDescriptionWithSpaces.
/**
* Tests a schema version that includes a description with spaces.
*/
@Test
public void extractSchemaVersionWithDescriptionWithSpaces() {
Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription("9_4__Big_jump", "", "__", "");
MigrationVersion version = info.getLeft();
String description = info.getRight();
assertEquals("9.4", version.toString());
assertEquals("Big jump", description);
}
Aggregations