Add missing tests for reflection hints

See gh-51382
This commit is contained in:
Moritz Halbritter
2026-08-27 09:32:13 +02:00
parent 8b35236d92
commit 6c33f551e7
@@ -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);