|
|
|
@ -38,6 +38,7 @@ import org.springframework.boot.test.util.EnvironmentTestUtils;
|
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.context.annotation.Primary;
|
|
|
|
|
import org.springframework.test.util.ReflectionTestUtils;
|
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
|
|
|
|
|
@ -254,12 +255,20 @@ public class LiquibaseAutoConfigurationTests {
|
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
|
this.context.refresh();
|
|
|
|
|
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
|
|
|
|
|
assertThat(liquibase.getDataSource()).isNotNull();
|
|
|
|
|
assertThat(liquibase.getDataSource())
|
|
|
|
|
.isEqualTo(this.context.getBean("liquibaseDataSource"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
static class LiquibaseDataSourceConfiguration {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@Primary
|
|
|
|
|
public DataSource normalDataSource() {
|
|
|
|
|
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:normal").username("sa")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@LiquibaseDataSource
|
|
|
|
|
@Bean
|
|
|
|
|
public DataSource liquibaseDataSource() {
|
|
|
|
|