Add boot42-preview module: Spring Boot 4.2.0-M2 vs 4.1.1 forwarded headers, AMQP starters, buildpack cache, RestTemplate removal warnings

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gth99spB1CzQmBFofXmU4Z
This commit is contained in:
Claude
2026-09-28 08:40:07 +00:00
parent 3e2029ab3a
commit acd63e658b
24 changed files with 608 additions and 0 deletions
@@ -0,0 +1,32 @@
package com.ankurm.boot42;
import java.util.Map;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.web.client.RestClient;
/** Starts the real application with the given properties on a random port. */
final class BootRun {
private BootRun() {
}
static ConfigurableApplicationContext start(String... props) {
return new SpringApplicationBuilder(Boot42PreviewApplication.class)
.web(WebApplicationType.SERVLET)
.properties(props)
.properties("server.port=0", "spring.main.banner-mode=off", "logging.level.root=WARN")
.run();
}
static RestClient client(ConfigurableApplicationContext ctx) {
Environment env = ctx.getEnvironment();
return RestClient.create("http://localhost:" + env.getProperty("local.server.port"));
}
static Map<?, ?> whoAmI(ConfigurableApplicationContext ctx, Map<String, String> headers) {
return client(ctx).get().uri("/whoami").headers(h -> headers.forEach(h::add)).retrieve().body(Map.class);
}
}