From 65b994cad19dd33534b79c0c2be8bbcdd00af2c0 Mon Sep 17 00:00:00 2001 From: Marcus Da Coregio Date: Wed, 13 Jul 2022 10:30:46 -0300 Subject: [PATCH] Polish RuntimeHintsRegistrar Add RuntimeHints suffix to classes Make classes package-private Use ReflectionUtilsPredicates#serialization Closes gh-2111 Closes gh-2112 --- ...=> CommonSessionSecurityRuntimeHints.java} | 2 +- ...va => WebSessionSecurityRuntimeHints.java} | 2 +- ...a => HttpSessionSecurityRuntimeHints.java} | 2 +- .../resources/META-INF/spring/aot.factories | 6 +- ...mmonSessionSecurityRuntimeHintsTests.java} | 13 ++-- .../hint/SerializationHintsPredicates.java | 73 ------------------- ... WebSessionSecurityRuntimeHintsTests.java} | 18 ++--- ...HttpSessionSecurityRuntimeHintsTests.java} | 18 ++--- ...ints.java => SessionJdbcRuntimeHints.java} | 2 +- .../resources/META-INF/spring/aot.factories | 2 +- ...java => SessionJdbcRuntimeHintsTests.java} | 14 ++-- 11 files changed, 40 insertions(+), 112 deletions(-) rename spring-session-core/src/main/java/org/springframework/session/aot/hint/{CommonSessionSecurityHints.java => CommonSessionSecurityRuntimeHints.java} (98%) rename spring-session-core/src/main/java/org/springframework/session/aot/hint/server/{WebSessionSecurityHints.java => WebSessionSecurityRuntimeHints.java} (95%) rename spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/{HttpSessionSecurityHints.java => HttpSessionSecurityRuntimeHints.java} (96%) rename spring-session-core/src/test/java/org/springframework/session/aot/hint/{CommonSessionSecurityHintsTests.java => CommonSessionSecurityRuntimeHintsTests.java} (91%) delete mode 100644 spring-session-core/src/test/java/org/springframework/session/aot/hint/SerializationHintsPredicates.java rename spring-session-core/src/test/java/org/springframework/session/aot/hint/server/{WebSessionSecurityHintsTests.java => WebSessionSecurityRuntimeHintsTests.java} (77%) rename spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/{HttpSessionSecurityHintsTests.java => HttpSessionSecurityRuntimeHintsTests.java} (82%) rename spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/{SessionJdbcSecurityHints.java => SessionJdbcRuntimeHints.java} (94%) rename spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/{SessionJdbcSecurityHintsTests.java => SessionJdbcRuntimeHintsTests.java} (76%) diff --git a/spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityHints.java b/spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHints.java similarity index 98% rename from spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityHints.java rename to spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHints.java index 47b15e57..10db91ec 100644 --- a/spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityHints.java +++ b/spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHints.java @@ -44,7 +44,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; * * @author Marcus Da Coregio */ -public class CommonSessionSecurityHints implements RuntimeHintsRegistrar { +class CommonSessionSecurityRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { diff --git a/spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityHints.java b/spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHints.java similarity index 95% rename from spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityHints.java rename to spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHints.java index c2adbc09..4f270780 100644 --- a/spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityHints.java +++ b/spring-session-core/src/main/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHints.java @@ -26,7 +26,7 @@ import org.springframework.util.ClassUtils; * * @author Marcus Da Coregio */ -public class WebSessionSecurityHints implements RuntimeHintsRegistrar { +class WebSessionSecurityRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { diff --git a/spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHints.java b/spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHints.java similarity index 96% rename from spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHints.java rename to spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHints.java index 2b023729..92c30ed3 100644 --- a/spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHints.java +++ b/spring-session-core/src/main/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHints.java @@ -34,7 +34,7 @@ import org.springframework.util.ClassUtils; * * @author Marcus Da Coregio */ -public class HttpSessionSecurityHints implements RuntimeHintsRegistrar { +class HttpSessionSecurityRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { diff --git a/spring-session-core/src/main/resources/META-INF/spring/aot.factories b/spring-session-core/src/main/resources/META-INF/spring/aot.factories index 2f63cf42..d9cd3040 100644 --- a/spring-session-core/src/main/resources/META-INF/spring/aot.factories +++ b/spring-session-core/src/main/resources/META-INF/spring/aot.factories @@ -1,4 +1,4 @@ org.springframework.aot.hint.RuntimeHintsRegistrar=\ -org.springframework.session.aot.hint.CommonSessionSecurityHints,\ -org.springframework.session.aot.hint.servlet.HttpSessionSecurityHints,\ -org.springframework.session.aot.hint.server.WebSessionSecurityHints +org.springframework.session.aot.hint.CommonSessionSecurityRuntimeHints,\ +org.springframework.session.aot.hint.servlet.HttpSessionSecurityRuntimeHints,\ +org.springframework.session.aot.hint.server.WebSessionSecurityRuntimeHints diff --git a/spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityHintsTests.java b/spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHintsTests.java similarity index 91% rename from spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityHintsTests.java rename to spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHintsTests.java index af3262a1..cd2ce3e3 100644 --- a/spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityHintsTests.java +++ b/spring-session-core/src/test/java/org/springframework/session/aot/hint/CommonSessionSecurityRuntimeHintsTests.java @@ -27,6 +27,7 @@ import org.junit.jupiter.params.provider.MethodSource; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; +import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.authentication.AccountExpiredException; @@ -47,28 +48,28 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link CommonSessionSecurityHints} + * Tests for {@link CommonSessionSecurityRuntimeHints} * * @author Marcus Da Coregio */ -class CommonSessionSecurityHintsTests { +class CommonSessionSecurityRuntimeHintsTests { private final RuntimeHints hints = new RuntimeHints(); - private final CommonSessionSecurityHints commonSessionSecurityHints = new CommonSessionSecurityHints(); + private final CommonSessionSecurityRuntimeHints commonSessionSecurityRuntimeHints = new CommonSessionSecurityRuntimeHints(); @ParameterizedTest @MethodSource("getSerializationHintTypes") void coreTypesHasHints(TypeReference typeReference) { - this.commonSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); - assertThat(new SerializationHintsPredicates().onType(typeReference)).accepts(this.hints); + this.commonSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.serialization().onType(typeReference)).accepts(this.hints); } @Test void aotFactoriesContainsRegistrar() { boolean match = SpringFactoriesLoader.forResourceLocation("META-INF/spring/aot.factories") .load(RuntimeHintsRegistrar.class).stream() - .anyMatch((registrar) -> registrar instanceof CommonSessionSecurityHints); + .anyMatch((registrar) -> registrar instanceof CommonSessionSecurityRuntimeHints); assertThat(match).isTrue(); } diff --git a/spring-session-core/src/test/java/org/springframework/session/aot/hint/SerializationHintsPredicates.java b/spring-session-core/src/test/java/org/springframework/session/aot/hint/SerializationHintsPredicates.java deleted file mode 100644 index 89c850aa..00000000 --- a/spring-session-core/src/test/java/org/springframework/session/aot/hint/SerializationHintsPredicates.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2014-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.session.aot.hint; - -import java.util.function.Predicate; - -import org.springframework.aot.hint.RuntimeHints; -import org.springframework.aot.hint.RuntimeHintsPredicates; -import org.springframework.aot.hint.SerializationHints; -import org.springframework.aot.hint.TypeReference; -import org.springframework.util.Assert; - -/** - * Generator of {@link SerializationHints} predicates, testing whether the given hints - * match the expected behavior for serialization. - * - * @author Marcus Da Coregio - * @see RuntimeHintsPredicates - */ -public class SerializationHintsPredicates { - - /** - * Return a predicate that checks whether a serialization hint is registered for the - * given type. - * @param typeReference the type - * @return the {@link RuntimeHints} predicate - */ - public TypeHintPredicate onType(TypeReference typeReference) { - Assert.notNull(typeReference, "'typeReference' should not be null"); - return new TypeHintPredicate(typeReference); - } - - /** - * Return a predicate that checks whether a serialization hint is registered for the - * given type. - * @param type the type - * @return the {@link RuntimeHints} predicate - */ - public TypeHintPredicate onType(Class type) { - Assert.notNull(type, "'type' should not be null"); - return new TypeHintPredicate(TypeReference.of(type)); - } - - public static class TypeHintPredicate implements Predicate { - - private final TypeReference type; - - TypeHintPredicate(TypeReference type) { - this.type = type; - } - - @Override - public boolean test(RuntimeHints hints) { - return hints.serialization().javaSerialization().anyMatch((hint) -> hint.getType().equals(this.type)); - } - - } - -} diff --git a/spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityHintsTests.java b/spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHintsTests.java similarity index 77% rename from spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityHintsTests.java rename to spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHintsTests.java index 0ba05e4c..fa0a4dcc 100644 --- a/spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityHintsTests.java +++ b/spring-session-core/src/test/java/org/springframework/session/aot/hint/server/WebSessionSecurityRuntimeHintsTests.java @@ -21,9 +21,9 @@ import org.mockito.MockedStatic; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; +import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.security.web.server.csrf.DefaultCsrfToken; -import org.springframework.session.aot.hint.SerializationHintsPredicates; import org.springframework.util.ClassUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -32,20 +32,20 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mockStatic; /** - * Tests for {@link WebSessionSecurityHints} + * Tests for {@link WebSessionSecurityRuntimeHints} * * @author Marcus Da Coregio */ -class WebSessionSecurityHintsTests { +class WebSessionSecurityRuntimeHintsTests { private final RuntimeHints hints = new RuntimeHints(); - private final WebSessionSecurityHints webSessionSecurityHints = new WebSessionSecurityHints(); + private final WebSessionSecurityRuntimeHints webSessionSecurityRuntimeHints = new WebSessionSecurityRuntimeHints(); @Test void defaultCsrfTokenHasHints() { - this.webSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); - assertThat(new SerializationHintsPredicates().onType(DefaultCsrfToken.class)).accepts(this.hints); + this.webSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.serialization().onType(DefaultCsrfToken.class)).accepts(this.hints); } @Test @@ -53,7 +53,7 @@ class WebSessionSecurityHintsTests { try (MockedStatic classUtilsMock = mockStatic(ClassUtils.class)) { classUtilsMock.when(() -> ClassUtils.isPresent(eq("org.springframework.web.server.WebSession"), any())) .thenReturn(false); - this.webSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.webSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(this.hints.serialization().javaSerialization()).isEmpty(); } } @@ -65,7 +65,7 @@ class WebSessionSecurityHintsTests { .when(() -> ClassUtils .isPresent(eq("org.springframework.security.web.server.csrf.DefaultCsrfToken"), any())) .thenReturn(false); - this.webSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.webSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(this.hints.serialization().javaSerialization()).isEmpty(); } } @@ -74,7 +74,7 @@ class WebSessionSecurityHintsTests { void aotFactoriesContainsRegistrar() { boolean match = SpringFactoriesLoader.forResourceLocation("META-INF/spring/aot.factories") .load(RuntimeHintsRegistrar.class).stream() - .anyMatch((registrar) -> registrar instanceof WebSessionSecurityHints); + .anyMatch((registrar) -> registrar instanceof WebSessionSecurityRuntimeHints); assertThat(match).isTrue(); } diff --git a/spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHintsTests.java b/spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHintsTests.java similarity index 82% rename from spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHintsTests.java rename to spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHintsTests.java index 4f416d8d..ca25538d 100644 --- a/spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityHintsTests.java +++ b/spring-session-core/src/test/java/org/springframework/session/aot/hint/servlet/HttpSessionSecurityRuntimeHintsTests.java @@ -28,12 +28,12 @@ import org.mockito.MockedStatic; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; +import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.security.web.authentication.WebAuthenticationDetails; import org.springframework.security.web.csrf.DefaultCsrfToken; import org.springframework.security.web.savedrequest.DefaultSavedRequest; import org.springframework.security.web.savedrequest.SavedCookie; -import org.springframework.session.aot.hint.SerializationHintsPredicates; import org.springframework.util.ClassUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -42,21 +42,21 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mockStatic; /** - * Tests for {@link HttpSessionSecurityHints} + * Tests for {@link HttpSessionSecurityRuntimeHints} * * @author Marcus Da Coregio */ -class HttpSessionSecurityHintsTests { +class HttpSessionSecurityRuntimeHintsTests { private final RuntimeHints hints = new RuntimeHints(); - private final HttpSessionSecurityHints httpSessionSecurityHints = new HttpSessionSecurityHints(); + private final HttpSessionSecurityRuntimeHints httpSessionSecurityRuntimeHints = new HttpSessionSecurityRuntimeHints(); @ParameterizedTest @MethodSource("getSerializationHintTypes") void httpSessionHasHints(TypeReference typeReference) { - this.httpSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); - assertThat(new SerializationHintsPredicates().onType(typeReference)).accepts(this.hints); + this.httpSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.serialization().onType(typeReference)).accepts(this.hints); } @Test @@ -64,7 +64,7 @@ class HttpSessionSecurityHintsTests { try (MockedStatic classUtilsMock = mockStatic(ClassUtils.class)) { classUtilsMock.when(() -> ClassUtils.isPresent(eq("jakarta.servlet.http.HttpSession"), any())) .thenReturn(false); - this.httpSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.httpSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(this.hints.serialization().javaSerialization()).isEmpty(); } } @@ -75,7 +75,7 @@ class HttpSessionSecurityHintsTests { classUtilsMock.when( () -> ClassUtils.isPresent(eq("org.springframework.security.web.csrf.DefaultCsrfToken"), any())) .thenReturn(false); - this.httpSessionSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.httpSessionSecurityRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(this.hints.serialization().javaSerialization()).isEmpty(); } } @@ -84,7 +84,7 @@ class HttpSessionSecurityHintsTests { void aotFactoriesContainsRegistrar() { boolean match = SpringFactoriesLoader.forResourceLocation("META-INF/spring/aot.factories") .load(RuntimeHintsRegistrar.class).stream() - .anyMatch((registrar) -> registrar instanceof HttpSessionSecurityHints); + .anyMatch((registrar) -> registrar instanceof HttpSessionSecurityRuntimeHints); assertThat(match).isTrue(); } diff --git a/spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHints.java b/spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHints.java similarity index 94% rename from spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHints.java rename to spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHints.java index b2806d73..c0095724 100644 --- a/spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHints.java +++ b/spring-session-jdbc/src/main/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHints.java @@ -26,7 +26,7 @@ import org.springframework.aot.hint.TypeReference; * * @author Marcus Da Coregio */ -public class SessionJdbcSecurityHints implements RuntimeHintsRegistrar { +class SessionJdbcRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { diff --git a/spring-session-jdbc/src/main/resources/META-INF/spring/aot.factories b/spring-session-jdbc/src/main/resources/META-INF/spring/aot.factories index 8097ed4e..4001c9a7 100644 --- a/spring-session-jdbc/src/main/resources/META-INF/spring/aot.factories +++ b/spring-session-jdbc/src/main/resources/META-INF/spring/aot.factories @@ -1,2 +1,2 @@ org.springframework.aot.hint.RuntimeHintsRegistrar=\ -org.springframework.session.jdbc.aot.hint.SessionJdbcSecurityHints +org.springframework.session.jdbc.aot.hint.SessionJdbcRuntimeHints diff --git a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHintsTests.java b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHintsTests.java similarity index 76% rename from spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHintsTests.java rename to spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHintsTests.java index b2f480a6..04e448a1 100644 --- a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcSecurityHintsTests.java +++ b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/aot/hint/SessionJdbcRuntimeHintsTests.java @@ -19,42 +19,42 @@ package org.springframework.session.jdbc.aot.hint; import org.junit.jupiter.api.Test; import org.springframework.aot.hint.RuntimeHints; -import org.springframework.aot.hint.RuntimeHintsPredicates; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; +import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.core.io.support.SpringFactoriesLoader; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link SessionJdbcSecurityHints} + * Tests for {@link SessionJdbcRuntimeHints} * * @author Marcus Da Coregio */ -class SessionJdbcSecurityHintsTests { +class SessionJdbcRuntimeHintsTests { private final RuntimeHints hints = new RuntimeHints(); - private final SessionJdbcSecurityHints sessionJdbcSecurityHints = new SessionJdbcSecurityHints(); + private final SessionJdbcRuntimeHints sessionJdbcRuntimeHints = new SessionJdbcRuntimeHints(); @Test void aotFactoriesContainsRegistrar() { boolean match = SpringFactoriesLoader.forResourceLocation("META-INF/spring/aot.factories") .load(RuntimeHintsRegistrar.class).stream() - .anyMatch((registrar) -> registrar instanceof SessionJdbcSecurityHints); + .anyMatch((registrar) -> registrar instanceof SessionJdbcRuntimeHints); assertThat(match).isTrue(); } @Test void jdbcSchemasHasHints() { - this.sessionJdbcSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.sessionJdbcRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(RuntimeHintsPredicates.resource().forResource("org/springframework/session/jdbc/schema.sql")) .accepts(this.hints); } @Test void dataSourceHasHints() { - this.sessionJdbcSecurityHints.registerHints(this.hints, getClass().getClassLoader()); + this.sessionJdbcRuntimeHints.registerHints(this.hints, getClass().getClassLoader()); assertThat(RuntimeHintsPredicates.reflection().onType(TypeReference.of("javax.sql.DataSource"))) .accepts(this.hints); }