package ch.inftec.flyway.core;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.internal.dbsupport.DbSupport;
import org.flywaydb.core.internal.dbsupport.DbSupportFactory;
import org.junit.Before;
import java.util.Properties;
/**
* Created by rotscher on 5/20/14.
*/
public class AbstractRepeatableFlywayTest {
protected final Flyway flyway = new Flyway();
private RepeatableFlyway repeatableFlyway;
@Before
public void setUp() throws Exception {
Properties properties = new Properties();
properties.load(RepeatableFlyway.class.getResourceAsStream("mysql.properties"));
flyway.configure(properties);
RepeatableFlyway.configure(flyway, properties);
DbSupport dbSupport = DbSupportFactory.createDbSupport(flyway.getDataSource().getConnection(), false);
dbSupport.getCurrentSchema().drop();
dbSupport.getCurrentSchema().create();
flyway.init();
}
}