OptimizedFlywayTestExecutionListener.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:embedded-database-spring-test 作者:
private static void prepareDataSourceContext(FlywayDataSourceContext dataSourceContext, Flyway flywayBean, FlywayTest annotation) throws Exception {
    if (isAppendable(flywayBean, annotation)) {
        dataSourceContext.reload(flywayBean);
    } else {
        String[] oldLocations = flywayBean.getLocations();
        try {
            if (annotation.overrideLocations()) {
                flywayBean.setLocations(annotation.locationsForMigrate());
            } else {
                flywayBean.setLocations(ObjectArrays.concat(oldLocations, annotation.locationsForMigrate(), String.class));
            }
            dataSourceContext.reload(flywayBean);
        } finally {
            flywayBean.setLocations(oldLocations);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号