mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Start building against Spring Framework 7.0.6 snapshots
See gh-49418
This commit is contained in:
+3
-3
@@ -56,7 +56,7 @@ import org.springframework.aot.generate.GeneratedFiles.FileHandler;
|
||||
import org.springframework.aot.generate.GeneratedFiles.Kind;
|
||||
import org.springframework.aot.generate.GenerationContext;
|
||||
import org.springframework.aot.hint.MemberCategory;
|
||||
import org.springframework.aot.hint.SerializationHints;
|
||||
import org.springframework.aot.hint.ReflectionHints;
|
||||
import org.springframework.aot.hint.TypeReference;
|
||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
|
||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
|
||||
@@ -187,8 +187,8 @@ class SpringBootJoranConfigurator extends JoranConfigurator {
|
||||
.handleFile(Kind.RESOURCE, MODEL_RESOURCE_LOCATION,
|
||||
new RequireNewOrMatchingContentFileHandler(serializedModel));
|
||||
generationContext.getRuntimeHints().resources().registerPattern(MODEL_RESOURCE_LOCATION);
|
||||
SerializationHints serializationHints = generationContext.getRuntimeHints().serialization();
|
||||
serializationTypes(this.model).forEach(serializationHints::registerType);
|
||||
ReflectionHints reflectionHints = generationContext.getRuntimeHints().reflection();
|
||||
serializationTypes(this.model).forEach(reflectionHints::registerJavaSerialization);
|
||||
reflectionTypes(this.model).forEach((type) -> generationContext.getRuntimeHints()
|
||||
.reflection()
|
||||
.registerType(TypeReference.of(type), MemberCategory.INVOKE_PUBLIC_METHODS,
|
||||
|
||||
+11
-19
@@ -26,7 +26,6 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
|
||||
@@ -50,10 +49,9 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.aot.generate.GeneratedFiles.Kind;
|
||||
import org.springframework.aot.generate.InMemoryGeneratedFiles;
|
||||
import org.springframework.aot.hint.JavaSerializationHint;
|
||||
import org.springframework.aot.hint.MemberCategory;
|
||||
import org.springframework.aot.hint.ReflectionHints;
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.SerializationHints;
|
||||
import org.springframework.aot.hint.TypeHint;
|
||||
import org.springframework.aot.hint.TypeReference;
|
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
||||
@@ -89,12 +87,11 @@ class LogbackConfigurationAotContributionTests {
|
||||
InMemoryGeneratedFiles generatedFiles = generationContext.getGeneratedFiles();
|
||||
assertThat(generatedFiles).has(resource("META-INF/spring/logback-model"));
|
||||
assertThat(generatedFiles).has(resource("META-INF/spring/logback-pattern-rules"));
|
||||
SerializationHints serializationHints = generationContext.getRuntimeHints().serialization();
|
||||
assertThat(serializationHints.javaSerializationHints()
|
||||
.map(JavaSerializationHint::getType)
|
||||
.map(TypeReference::getName))
|
||||
.containsExactlyInAnyOrder(namesOf(Model.class, ArrayList.class, Boolean.class, Integer.class));
|
||||
assertThat(generationContext.getRuntimeHints().reflection().typeHints()).isEmpty();
|
||||
ReflectionHints reflectionHints = generationContext.getRuntimeHints().reflection();
|
||||
assertThat(reflectionHints.typeHints().map(TypeHint::getType)).containsExactlyInAnyOrderElementsOf(
|
||||
TypeReference.listOf(Model.class, ArrayList.class, Boolean.class, Integer.class));
|
||||
assertThat(reflectionHints.typeHints().map(TypeHint::hasJavaSerialization).distinct()).singleElement()
|
||||
.isEqualTo(true);
|
||||
InputStreamSource generatedFile = generatedFiles.getGeneratedFile(Kind.RESOURCE,
|
||||
"META-INF/spring/logback-pattern-rules");
|
||||
assertThat(generatedFile).isNotNull();
|
||||
@@ -111,12 +108,11 @@ class LogbackConfigurationAotContributionTests {
|
||||
InMemoryGeneratedFiles generatedFiles = generationContext.getGeneratedFiles();
|
||||
assertThat(generatedFiles).has(resource("META-INF/spring/logback-model"));
|
||||
assertThat(generatedFiles).has(resource("META-INF/spring/logback-pattern-rules"));
|
||||
SerializationHints serializationHints = generationContext.getRuntimeHints().serialization();
|
||||
assertThat(serializationHints.javaSerializationHints()
|
||||
.map(JavaSerializationHint::getType)
|
||||
.map(TypeReference::getName))
|
||||
.containsExactlyInAnyOrder(namesOf(Model.class, ArrayList.class, Boolean.class, Integer.class));
|
||||
assertThat(generationContext.getRuntimeHints().reflection().typeHints()).isEmpty();
|
||||
ReflectionHints reflectionHints = generationContext.getRuntimeHints().reflection();
|
||||
assertThat(reflectionHints.typeHints().map(TypeHint::getType)).containsExactlyInAnyOrderElementsOf(
|
||||
TypeReference.listOf(Model.class, ArrayList.class, Boolean.class, Integer.class));
|
||||
assertThat(reflectionHints.typeHints().map(TypeHint::hasJavaSerialization).distinct()).singleElement()
|
||||
.isEqualTo(true);
|
||||
InputStreamSource generatedFile = generatedFiles.getGeneratedFile(Kind.RESOURCE,
|
||||
"META-INF/spring/logback-pattern-rules");
|
||||
assertThat(generatedFile).isNotNull();
|
||||
@@ -330,10 +326,6 @@ class LogbackConfigurationAotContributionTests {
|
||||
contribution.applyTo(generationContext, mock(BeanFactoryInitializationCode.class));
|
||||
}
|
||||
|
||||
private String[] namesOf(Class<?>... types) {
|
||||
return Stream.of(types).map(Class::getName).toArray(String[]::new);
|
||||
}
|
||||
|
||||
private void withSystemProperty(String name, String value, Runnable action) {
|
||||
System.setProperty(name, value);
|
||||
try {
|
||||
|
||||
+3
-3
@@ -31,12 +31,12 @@ public class MyRuntimeHints implements RuntimeHintsRegistrar {
|
||||
Method method = ReflectionUtils.findMethod(MyClass.class, "sayHello", String.class);
|
||||
hints.reflection().registerMethod(method, ExecutableMode.INVOKE);
|
||||
|
||||
// Register type for java serialization
|
||||
hints.reflection().registerJavaSerialization(MySerializableClass.class);
|
||||
|
||||
// Register resources
|
||||
hints.resources().registerPattern("my-resource.txt");
|
||||
|
||||
// Register serialization
|
||||
hints.serialization().registerType(MySerializableClass.class);
|
||||
|
||||
// Register proxy
|
||||
hints.proxies().registerJdkProxy(MyInterface.class);
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ mockitoVersion=5.20.0
|
||||
nativeBuildToolsVersion=0.11.4
|
||||
nullabilityPluginVersion=0.0.11
|
||||
snakeYamlVersion=2.5
|
||||
springFrameworkVersion=7.0.5
|
||||
springFrameworkVersion=7.0.6-SNAPSHOT
|
||||
springFramework60xVersion=6.0.23
|
||||
tomcatVersion=11.0.18
|
||||
|
||||
|
||||
Reference in New Issue
Block a user