diff --git a/module/spring-boot-ldap/src/test/java/org/springframework/boot/ldap/autoconfigure/LdapAutoConfigurationTests.java b/module/spring-boot-ldap/src/test/java/org/springframework/boot/ldap/autoconfigure/LdapAutoConfigurationTests.java index eadcff8af1f..2086bbb84c4 100644 --- a/module/spring-boot-ldap/src/test/java/org/springframework/boot/ldap/autoconfigure/LdapAutoConfigurationTests.java +++ b/module/spring-boot-ldap/src/test/java/org/springframework/boot/ldap/autoconfigure/LdapAutoConfigurationTests.java @@ -27,6 +27,9 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.aot.hint.MemberCategory; +import org.springframework.aot.hint.RuntimeHints; +import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.boot.ssl.DefaultSslBundleRegistry; @@ -304,6 +307,16 @@ class LdapAutoConfigurationTests { }); } + @Test + void shouldRegisterHintsForSocketFactoryLoadedByJndi() { + RuntimeHints runtimeHints = new RuntimeHints(); + new LdapAutoConfiguration.LdapAutoConfigurationRuntimeHints().registerHints(runtimeHints, + getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.reflection() + .onType(LdapSslSocketFactory.class) + .withMemberCategory(MemberCategory.INVOKE_PUBLIC_METHODS)).accepts(runtimeHints); + } + @Test void shouldFailWhenSslBundleConfiguredWithMixedSchemeUrls() { SslBundle sslBundle = mock(SslBundle.class);