@PostConstruct public void checkChangelogExists() { if (this.properties.isCheckChangeLogLocation()) { Resource resource = this.resourceLoader .getResource(this.properties.getChangeLog()); Assert.state(resource.exists(), "Cannot find changelog location: " + resource + " (please add changelog or check your Liquibase " + "configuration)"); } ServiceLocator serviceLocator = ServiceLocator.getInstance(); serviceLocator.addPackageToScan( CommonsLoggingLiquibaseLogger.class.getPackage().getName()); }
@Test public void testLogger() throws Exception { this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class); Object log = ReflectionTestUtils.getField(liquibase, "log"); assertThat(log).isInstanceOf(CommonsLoggingLiquibaseLogger.class); }
@Test public void testLogger() throws Exception { this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class); Object log = ReflectionTestUtils.getField(liquibase, "log"); assertThat(log, instanceOf(CommonsLoggingLiquibaseLogger.class)); }