Repository navigation
Feat/2053 spring boot 4 - #2098
Merged
lbroudoux merged 18 commits intoMay 12, 2026
Merged
Conversation
…mport fixes - Bump spring-boot.version to 4.0.6 - Pin Jackson 2.x BOM to maintain compatibility with Quarkus 3 minion - Drop spring-boot-starter-aop (unused, replaced by spring-context) - Migrate package renames in SB 4: - org.springframework.boot.autoconfigure.kafka -> org.springframework.boot.kafka.autoconfigure - org.springframework.boot.autoconfigure.security.oauth2.client.servlet -> org.springframework.boot.security.oauth2.client.autoconfigure.servlet - org.springframework.boot.web.client -> org.springframework.boot.restclient Pending: OAuth2AuthorizedClientProvider — Password Grant removed in Spring Security 7, needs design decision (drop / reimplement manually / deprecate). Signed-off-by: Git-HimanshuRathi <[email protected]>
… client autoconfig package - Add spring-boot-starter-restclient (RestTemplateBuilder moved out of spring-boot in SB 4) - Add spring-boot-starter-kafka (KafkaProperties moved out of spring-boot-autoconfigure) - Drop the .servlet sub-package from OAuth2ClientAutoConfiguration import (SB 4 merged the servlet and reactive variants into a single class) Signed-off-by: Git-HimanshuRathi <[email protected]>
Heyy-Himanshuu
requested review from
SebastienDegodez,
lbroudoux and
yada
as code owners
May 7, 2026 07:37
Heyy-Himanshuu
marked this pull request as draft
May 7, 2026 08:30
…rn in webapp Spring Framework 7 and Spring Security 7 (pulled in by Spring Boot 4) renamed, removed, or restructured several APIs. Mechanical fixes: Spring Framework 7 - HttpHeaders no longer extends MultiValueMap. Migrate Map-style accessors: * containsKey() -> containsHeader() * entrySet() -> headerSet() * put() -> addAll() - Bridge HttpHeaders -> Map<String,List<String>> call sites with .asMultiValueMap() (deprecated for removal — long-term these signatures should accept HttpHeaders directly) - UriComponentsBuilder.fromHttpUrl() -> fromUriString() - HttpComponentsClientHttpRequestFactory.setConnectTimeout(int) removed — configure on the underlying RequestConfig instead - Disambiguate ResponseEntity null-body constructor in SecretController Spring Boot 4 - RestTemplateBuilder.setReadTimeout(Duration) -> readTimeout(Duration) - KafkaProperties.Producer.buildProperties(SslBundles) -> buildProperties() Spring Security 7 - Resource Owner Password Grant removed (per OAuth 2.1). Microcks reimplements it manually via RestClient against the configured token endpoint to keep legacy IDP support during test execution. - Default*TokenResponseClient classes renamed to RestClient*TokenResponseClient - AuthorizationGrantType.PASSWORD and OAuth2ParameterNames.PASSWORD/USERNAME constants removed alongside the grant; the parameter names themselves remain part of the OAuth 2.0 spec. Signed-off-by: Git-HimanshuRathi <[email protected]>
The root pom previously pinned <junit.version>5.12.2</junit.version> for junit-jupiter, but junit-platform-* jars were inherited from Spring Boot's BOM unpinned. Spring Boot 4 manages JUnit Jupiter 6.0.3 / Platform 6.x; Jupiter 5.12 against Platform 6.x throws: OutputDirectoryCreator not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars Drop the version override so the SB4 BOM manages the whole JUnit family consistently. Also drop the explicit <version>1.12.2</version> on junit-platform-launcher in commons/util and commons/util-el for the same reason. Effect: commons/util, commons/model, commons/util-el tests now pass under Spring Boot 4.0.6. Signed-off-by: Git-HimanshuRathi <[email protected]>
…Security 6.5 Spring Security 7 removed the Resource Owner Password Credentials grant per OAuth 2.1 (DefaultPasswordTokenResponseClient, OAuth2PasswordGrantRequest, AuthorizationGrantType.PASSWORD, OAuth2ParameterNames.PASSWORD/USERNAME). Per @lbroudoux's call on microcks#2053, vendor the two main classes into io.github.microcks.security.oauth2 with @deprecated(since="1.15.0", forRemoval=true) markers so the feature stays available for legacy IDPs in test contexts while we plan removal in 1.16.0. - OAuth2PasswordGrantRequest: vendored verbatim from SS 6.5; exposes a PASSWORD constant to replace the removed AuthorizationGrantType.PASSWORD. - DefaultPasswordTokenResponseClient: equivalent of the SS 6.5 class but re-implemented with RestClient since the SS 7 removal also took out the AbstractOAuth2AuthorizationGrantRequestEntityConverter machinery the original relied on. - OAuth2AuthorizedClientProvider: revert to the original code, only switching imports to the vendored package. - OAuth2AuthorizeClientProviderTest: same — imports updated to the vendored package (deprecation warnings are intentional). Signed-off-by: Git-HimanshuRathi <[email protected]>
… 4 modules Spring Boot 4 split the test infrastructure across new modules and moved several classes/annotations. Take the drop-in path: - Add spring-boot-starter-webmvc-test (provides AutoConfigureMockMvc, MockMvcPrint moved out of spring-boot-test-autoconfigure) - Add spring-boot-resttestclient (provides TestRestTemplate moved out of spring-boot-test). @SpringBootTest no longer auto-provides a TestRestTemplate bean, so AbstractBaseIT and MicrocksApplicationFuzz now also carry @AutoConfigureTestRestTemplate. Source updates in webapp/src/test/java: - TestRestTemplate: org.springframework.boot.test.web.client -> org.springframework.boot.resttestclient - AutoConfigureMockMvc / MockMvcPrint: org.springframework.boot.test.autoconfigure.web.servlet -> org.springframework.boot.webmvc.test.autoconfigure - @spybean: org.springframework.boot.test.mock.mockito.SpyBean -> @MockitoSpyBean from org.springframework.test.context.bean.override.mockito (the SB-test annotations were removed in favour of the Spring TestContext ones) - ClientHttpRequestFactorySettings.Redirects (removed) -> top-level HttpRedirects in org.springframework.boot.http.client (used by TestRestTemplate.withRedirects) The full RestTestClient migration is intentionally not in scope for this PR — see PR description for the trade-off. Signed-off-by: Git-HimanshuRathi <[email protected]>
… official one Spring Boot 4 ships its own spring-boot-starter-opentelemetry (released Nov 2025). Per Spring's docs the community io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter we used on SB 3.5 should not be mixed with the official one — drop it entirely along with the opentelemetry-instrumentation-bom import and the five exclusions that came with the community starter. Two transitive deps the community starter used to provide are now explicit: - opentelemetry-instrumentation-annotations (for @WithSpan, used in RestInvocationProcessor and GrpcInvocationProcessor). Pinned to 2.21.0 — not managed by Spring's BOM. - opentelemetry-sdk-extension-autoconfigure-spi (for the AutoConfigurationCustomizerProvider / ConfigProperties types used by OtelAutoConfigurationCustomizerProvider). Version managed by opentelemetry-bom imported via spring-boot-dependencies. NOTE: the customizer compiles against the SPI but Spring Boot 4's starter does not rely on the OTel SDK autoconfigure flow the same way the community starter did. The @bean AutoConfigurationCustomizerProvider hook may not fire at runtime — to validate via CI / integration tests, and rewire as a Spring bean if needed. Signed-off-by: Git-HimanshuRathi <[email protected]>
Heyy-Himanshuu
marked this pull request as ready for review
May 7, 2026 14:48
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Himanshu Rathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Signed-off-by: Git-HimanshuRathi <[email protected]>
Spring Boot 4 moved Mongo connection properties out of spring.data.mongodb.* into spring.mongodb.* (MongoProperties is now in org.springframework.boot.mongodb.autoconfigure). The legacy key was being silently ignored, so the auto-configured client fell back to localhost:27017 and failed every IT/Fuzz context load. Signed-off-by: Git-HimanshuRathi <[email protected]>
Spring Boot 4's spring-boot-starter-opentelemetry does not consume the OTel SDK-autoconfigure SPI the community starter relied on, so the @bean AutoConfigurationCustomizerProvider in OtelAutoConfigurationCustomizerProvider was never invoked at runtime and neither the local span storage processor nor the X-Trace-Id propagator reached the SDK. The community starter also provided the WithSpanAspect that wove @WithSpan-annotated methods, which Spring's official starter does not bundle. Three targeted changes: - Drop the dead AutoConfigurationCustomizerProvider bean. Expose XTraceIdTextMapPropagator as a plain TextMapPropagator @bean so Spring's OpenTelemetryTracingAutoConfiguration composes it via its ObjectProvider<TextMapPropagator> aggregation alongside W3C and baggage propagators. CustomExplainTraceProcessor is already a @component and is picked up the same way through ObjectProvider<SpanProcessor>. - Add a minimal WithSpanAspect (gated by otel.instrumentation.annotations.enabled) that opens a span using the OpenTelemetry-provided Tracer, makes it current, ends it on return, and records exceptions on failure. Pulls in spring-boot-starter-aspectj (renamed from spring-boot-starter-aop in Boot 4) for AspectJ proxy support. - Set management.tracing.sampling.probability=1.0 to preserve the 100 percent sampling the project already configured via the legacy otel.traces.sampler.arg=1.0 (which only applied under the SDK- autoconfigure pipeline). Also drops the now-unused opentelemetry-sdk-extension-autoconfigure-spi dependency. Signed-off-by: Git-HimanshuRathi <[email protected]>
lbroudoux
reviewed
May 11, 2026
lbroudoux
left a comment
Member
There was a problem hiding this comment.
Hey! Thanks a lot for a huge amount of work! It looks almost good to me even if I have a few questions. Can you check it out please?
JsScriptEngineBinderTest was the only caller and now uses an in-process HTTP server (b1969c6). Confirmed by grep that no other test references TestFetchController. Signed-off-by: Git-HimanshuRathi <[email protected]>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #2053
Done
pom.xml
spring-boot.version3.5.14 → 4.0.6spring-boot-starter-aop(project had zero AspectJ usage in main; SB4 renamed it to-aspectjanyway — added back asspring-boot-starter-aspectjlater forWithSpanAspect)spring-boot-starter-restclient(RestTemplateBuildermoved out ofspring-bootin SB4)spring-boot-starter-kafka(KafkaPropertiesmoved out ofspring-boot-autoconfigurein SB4)<junit.version>override — SB4 manages Jupiter 6.0.3 + Platform 6.x consistently; the override was maskingjunit-platform-launcherriding along unpinnedSB4 modularization — package renames (main)
org.springframework.boot.autoconfigure.kafka.KafkaProperties→org.springframework.boot.kafka.autoconfigure.KafkaPropertiesorg.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration→org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientAutoConfiguration(also dropped.servlet— servlet+reactive merged)org.springframework.boot.web.client.RestTemplateBuilder→org.springframework.boot.restclient.RestTemplateBuilderSpring Framework 7 API churn (main)
HttpHeadersno longer extendsMultiValueMap:containsKey()→containsHeader(),entrySet()→headerSet(),put()→addAll(); 4 call sites that passHttpHeaderswhereMap<String,List<String>>is expected now use.asMultiValueMap()UriComponentsBuilder.fromHttpUrl()→fromUriString()HttpComponentsClientHttpRequestFactory.setConnectTimeout(int)removed →RequestConfig.custom().setConnectTimeout(...)RestTemplateBuilder.setReadTimeout(Duration)→readTimeout(Duration)KafkaProperties.Producer.buildProperties(SslBundles)→buildProperties()ResponseEntitynull-body constructor disambiguated inSecretControllerSpring Security 7 — Resource Owner Password Grant removed
Per your guidance went with option (b) — vendored
DefaultPasswordTokenResponseClient+OAuth2PasswordGrantRequestintoio.github.microcks.security.oauth2.password.*so the feature keeps working under SB4 and can be properly deprecated in 1.16.0. Sibling clients (Default*TokenResponseClientfor Client Credentials and Refresh Token) got renamed toRestClient*TokenResponseClient.Test infrastructure (drop-in path, evaluation here)
TestRestTemplate→org.springframework.boot.resttestclient.TestRestTemplate+@AutoConfigureTestRestTemplateonAbstractBaseIT/MicrocksApplicationFuzz@SpyBean→@MockitoSpyBeanfromorg.springframework.test.context.bean.override.mockito@AutoConfigureMockMvc/MockMvcPrint→org.springframework.boot.webmvc.test.autoconfigure.*ClientHttpRequestFactorySettings.Redirects(removed) → top-levelHttpRedirectsfromorg.springframework.boot.http.clientspring.data.mongodb.uri→spring.mongodb.uri(Mongo connection props moved out ofspring.data.*in SB4 — testcontainer URI was silently ignored before this)OpenTelemetry — swapped community starter for Spring's official
io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter+opentelemetry-instrumentation-bom; pulled inspring-boot-starter-opentelemetry@Bean AutoConfigurationCustomizerProviderwas rewired:CustomExplainTraceProcessoris@Component→ picked up byOpenTelemetryTracingAutoConfiguration.spanProcessors(ObjectProvider<SpanProcessor>)XTraceIdTextMapPropagatorexposed as@Bean TextMapPropagator→ composed byotelContextPropagators(ObjectProvider<TextMapPropagator>)WithSpanAspectto replace the one the community starter brought in — the official starter intentionally doesn't ship one (rationale in the resolved review thread)management.tracing.sampling.probability=1.0to preserve the 100% sampling the project previously got via the SDK-autoconfigure-onlyotel.traces.sampler.arg=1.0Build status
✅
build-install— green✅
integration-tests— green (61 ITs)✅
fuzzing-tests— green✅
javadoc-check— green⬜
package-native— only runs post-merge on upstream (event_name != 'pull_request'). Audited locally: webappprocess-aotruns cleanly under SB 4.0.6 + JDK 25; native profile config (BP_JVM_VERSION=25, builder pinned, reachability metadata wiring) unchanged. Async minion is Quarkus, decoupled.Follow-ups (separate issues)
RestTestClient; rewrite the 4 SSE tests withRestClient.exchange(ExchangeFunction)so they keep raw stream access. Then drop thespring-boot-resttestclientdep.