Skip to content

Commit

Permalink
Update Liquibase
Browse files Browse the repository at this point in the history
  • Loading branch information
reneleonhardt committed Aug 18, 2024
1 parent 2378344 commit 8c9695e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ ext {
[name: 'no_sb', flyway: 'default', 'flyway-test': 'default', 'zonky-postgres': 'default']
]],
[name: 'liquibase', versions: [
[name: '3.5.5', liquibase: '3.5.5', spring: '4.3.30.RELEASE', 'spring-boot': '1.5.22.RELEASE'],
[name: '3.6.3', liquibase: '3.6.3', spring: '5.1.20.RELEASE', 'spring-boot': '2.1.18.RELEASE'],
[name: '3.7.0', liquibase: '3.7.0', spring: '5.1.20.RELEASE', 'spring-boot': '2.1.18.RELEASE'],
[name: '3.8.9', liquibase: '3.8.9', spring: '5.2.22.RELEASE', 'spring-boot': '2.2.13.RELEASE'],
[name: '3.9.0', liquibase: '3.9.0', spring: '5.2.22.RELEASE', 'spring-boot': '2.2.13.RELEASE'],
[name: '3.10.3', liquibase: '3.10.3', spring: '5.3.13', 'spring-boot': '2.4.13'],
[name: '4.4.3', liquibase: '4.4.3', spring: '5.3.27', 'spring-boot': '2.5.15'],
[name: '4.5.0', liquibase: '4.5.0', spring: '5.3.27', 'spring-boot': '2.6.15'],
// [name: '3.5.5', liquibase: '3.5.5', spring: '4.3.30.RELEASE', 'spring-boot': '1.5.22.RELEASE'],
// [name: '3.6.3', liquibase: '3.6.3', spring: '5.1.20.RELEASE', 'spring-boot': '2.1.18.RELEASE'],
// [name: '3.7.0', liquibase: '3.7.0', spring: '5.1.20.RELEASE', 'spring-boot': '2.1.18.RELEASE'],
// [name: '3.8.9', liquibase: '3.8.9', spring: '5.2.22.RELEASE', 'spring-boot': '2.2.13.RELEASE'],
// [name: '3.9.0', liquibase: '3.9.0', spring: '5.2.22.RELEASE', 'spring-boot': '2.2.13.RELEASE'],
// [name: '3.10.3', liquibase: '3.10.3', spring: '5.3.13', 'spring-boot': '2.4.13'],
// [name: '4.4.3', liquibase: '4.4.3', spring: '5.3.27', 'spring-boot': '2.5.15'],
// [name: '4.5.0', liquibase: '4.5.0', spring: '5.3.27', 'spring-boot': '2.6.15'],
[name: '4.9.1', liquibase: '4.9.1', spring: '5.3.31', 'spring-boot': '2.7.18'],
[name: 'no_sb', liquibase: 'default']
]],
Expand Down Expand Up @@ -280,7 +280,7 @@ project(':embedded-database-spring-test') {
optImplementation('org.springframework.boot:spring-boot-starter-test:2.7.18') {
exclude group: 'org.mockito'
}
optImplementation 'org.liquibase:liquibase-core:3.10.3'
optImplementation 'org.liquibase:liquibase-core:4.9.1'

api 'org.springframework:spring-context:5.3.31'
api 'org.springframework:spring-test:5.3.31'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ protected InputStream openChangeLogStream(String changeLogPath) throws IOExcepti
SpringLiquibase springLiquibase = new SpringLiquibase();
springLiquibase.setResourceLoader(descriptor.getResourceLoader());
if (ClassUtils.isPresent("liquibase.integration.spring.SpringLiquibase$SpringResourceOpener", null)) {
SpringLiquibase.SpringResourceOpener resourceAccessor = springLiquibase.new SpringResourceOpener(descriptor.getChangeLog());
return StreamUtil.singleInputStream(changeLogPath, resourceAccessor);
return StreamUtil.openStream(changeLogPath, null, null, null);
} else if (ClassUtils.isPresent("liquibase.integration.spring.SpringLiquibase$SpringResourceAccessor", null)) {
Object resourceAccessor = ReflectionUtils.invokeConstructor("liquibase.integration.spring.SpringLiquibase$SpringResourceAccessor", springLiquibase);
return ReflectionUtils.invokeMethod(resourceAccessor, "openStream", null, changeLogPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public void afterTestClass(TestContext testContext) {
DatabaseContext databaseContext = applicationContext.getBean(DatabaseContext.class);
DatabaseProvider databaseProvider = applicationContext.getBean("dockerPostgresDatabaseProvider", DatabaseProvider.class);

verify(databaseContext, times(4)).reset();
verify(databaseContext, times(2)).reset();
verify(databaseContext, times(1)).apply(any());
verify(databaseProvider, times(3)).createDatabase(any());
verify(databaseProvider, times(1)).createDatabase(any());

Mockito.reset(databaseContext, databaseProvider);
}
Expand Down

0 comments on commit 8c9695e

Please sign in to comment.