Skip to content

Add spring-boot-starter-webflux-test and relocate the @WebFluxTest slice - #1122

Merged
MBoegers merged 2 commits into
mainfrom
webflux-test-starter
Aug 13, 2026
Merged

Add spring-boot-starter-webflux-test and relocate the @WebFluxTest slice#1122
MBoegers merged 2 commits into
mainfrom
webflux-test-starter

Conversation

@MBoegers

Copy link
Copy Markdown
Contributor

What's changed?

MigrateToModularStarters adds org.springframework.boot:spring-boot-starter-webflux-test (test scope) when SB3 test sources use @WebFluxTest or @AutoConfigureWebFlux, and MigrateAutoconfigurePackages relocates the slice types (WebFluxTest, AutoConfigureWebFlux, WebFluxTypeExcludeFilter) from org.springframework.boot.test.autoconfigure.web.reactive to org.springframework.boot.webflux.test.autoconfigure.

What's your motivation?

Customer-reported: after the Spring Boot 4 migration, modules whose tests use @WebFluxTest fail to compile — the annotation keeps its SB3 FQN and the dedicated SB4 starter is never added. The servlet twin has both halves (spring-boot-starter-webmvc-test entries + the test.autoconfigure.web.servlet ChangePackage); the reactive slice had neither.

Anything in particular you'd like reviewers to focus on?

  • Type-by-type rather than ChangePackage: the SB3 package splits — its WebTestClient types move to spring-boot-webtestclient (the existing block right below).
  • The gates are the two annotation FQNs, not the package, so MockMvc-backed @AutoConfigureWebTestClient users don't get spring-boot-starter-webflux-test (which aggregates spring-boot-starter-webflux). doesNotAddWebFluxTestStarterForAutoConfigureWebTestClientUsage guards this.
  • WebFluxTestContextBootstrapper is package-private in SB3 → no ChangeType.

Checklist

  • I've added unit tests to cover both positive and negative cases

…` slice

The SB3 package org.springframework.boot.test.autoconfigure.web.reactive
splits in Spring Boot 4: @WebFluxTest, @AutoConfigureWebFlux and
WebFluxTypeExcludeFilter move to spring-boot-webflux-test while the
WebTestClient types move to spring-boot-webtestclient. Modules using the
slice previously migrated without the dedicated starter and with stale
imports, breaking test compilation.
@MBoegers
MBoegers marked this pull request as ready for review August 13, 2026 12:50
@MBoegers
MBoegers requested a review from timtebeek August 13, 2026 12:50
@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Aug 13, 2026
@MBoegers
MBoegers merged commit c97c1b5 into main Aug 13, 2026
1 check passed
@MBoegers
MBoegers deleted the webflux-test-starter branch August 13, 2026 14:00
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants