Skip to content

Commit ac03522

Browse files
committed
#16 fix forward compatibility for Flyway 5.1.x
1 parent 64c2851 commit ac03522

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

embedded-database-spring-test/src/main/java/io/zonky/test/db/flyway/OptimizedFlywayTestExecutionListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ protected static MigrationResolver createMigrationResolver(Flyway flyway, String
235235

236236
if (flywayVersion >= 51) {
237237
ClassLoader classLoader = OptimizedFlywayTestExecutionListener.class.getClassLoader();
238-
Class<?> configType = ClassUtils.forName("org.flywaydb.core.api.configuration.ClassicConfiguration", classLoader);
238+
Class<?> configType = ClassUtils.forName("org.flywaydb.core.api.configuration.Configuration", classLoader);
239239
Object configInstance = getField(flyway, "configuration");
240240
Scanner scanner = Scanner.class.getDeclaredConstructor(configType).newInstance(configInstance);
241241
Object placeholderReplacer = invokeMethod(flyway, "createPlaceholderReplacer");
@@ -262,7 +262,7 @@ protected Flyway getFlywayBean(ApplicationContext applicationContext, FlywayTest
262262
protected static String[] getFlywayLocations(Flyway flyway) {
263263
try {
264264
if (flywayVersion >= 51) {
265-
return Arrays.<Object>stream(flyway.getLocations())
265+
return Arrays.stream((Object[]) invokeMethod(flyway, "getLocations"))
266266
.map(location -> invokeMethod(location, "getDescriptor"))
267267
.toArray(String[]::new);
268268
} else {

0 commit comments

Comments
 (0)