use of org.flywaydb.core.api.callback.BaseFlywayCallback in project flyway by flyway.
the class FlywayCallbackSmallTest method failingCallbackTest.
@Test(expected = IllegalStateException.class)
public void failingCallbackTest() {
FlywayCallback failingCallback = new BaseFlywayCallback() {
@Override
public void beforeMigrate(Connection connection) {
throw new IllegalStateException("Failing");
}
};
final Flyway flyway = new Flyway();
flyway.configure(createProperties("failing"));
flyway.setCallbacks(failingCallback);
assertNotNull(flyway.getDataSource());
flyway.migrate();
}
Aggregations