From d37098153cd92e2a0239db21f11e6bd5ec790e21 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 11 Jun 2024 09:35:59 -0700 Subject: [PATCH] Polish --- .../flyway/NativeImageResourceProviderCustomizer.java | 5 ++--- .../testing/testcontainers/vanilla/MyIntegrationTests.kt | 2 ++ .../testcontainers/serviceconnections/MyIntegrationTests.kt | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java index 3abbee4bf94..c9e3006b911 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java @@ -54,16 +54,15 @@ class NativeImageResourceProviderCustomizer extends ResourceProviderCustomizer { configuration.isFailOnMissingLocations()); } catch (NoSuchMethodError ex) { - // Flyway 10 return createFlyway10Scanner(configuration); } } private static Scanner createFlyway10Scanner(FluentConfiguration configuration) throws LinkageError { try { - Constructor scannerConstructor = Scanner.class.getDeclaredConstructor(Class.class, boolean.class, + Constructor constructor = Scanner.class.getDeclaredConstructor(Class.class, boolean.class, ResourceNameCache.class, LocationScannerCache.class, Configuration.class); - return (Scanner) scannerConstructor.newInstance(JavaMigration.class, false, new ResourceNameCache(), + return (Scanner) constructor.newInstance(JavaMigration.class, false, new ResourceNameCache(), new LocationScannerCache(), configuration); } catch (Exception ex) { diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt index d15a1bb6c63..e62e5804d7d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt @@ -32,8 +32,10 @@ class MyIntegrationTests { } companion object { + @Container val neo4j = Neo4jContainer("neo4j:5") + } } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/testcontainers/serviceconnections/MyIntegrationTests.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/testcontainers/serviceconnections/MyIntegrationTests.kt index 6f84114eb20..a5e1071d544 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/testcontainers/serviceconnections/MyIntegrationTests.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/testcontainers/serviceconnections/MyIntegrationTests.kt @@ -34,9 +34,12 @@ class MyIntegrationTests { } companion object { + @Container @ServiceConnection @JvmStatic val neo4j = Neo4jContainer("neo4j:5"); + } + }