Repository navigation
AutoConfigureWireMock missing in 5.0.0 #2397
Description
Activity
For people searching: #2289
Reacted by Siarhei KrukauYes, we removed the support in favour of the official WireMock's Spring Boot integration
Thanks for the clarification.
However, in practice this change creates a gap for WebFlux-based applications, especially Spring Cloud Gateway.
In Spring Cloud Contract 4.x,
@AutoConfigureWireMockwas effectively the only simple and reliable way to:- start WireMock inside the Spring Test lifecycle
- expose it as a Spring-managed component
- work correctly with WebFlux / reactive stack
- avoid lifecycle and threading issues (Netty vs blocking servers)
With 5.x, the recommendation is to use the official WireMock Spring Boot integration.
Unfortunately, that integration:- is primarily designed for Spring MVC
- relies on servlet-based infrastructure
- does not integrate cleanly with WebFlux / Gateway
- frequently leads to context hangs or startup issues in reactive tests
As a result, removing
@AutoConfigureWireMockeffectively removes the only out-of-the-box, reactive-safe solution for configuring WireMock in Spring Cloud Gateway tests.At the moment, there is no direct equivalent in 5.x that:
- is Spring-managed,
- reactive-friendly,
- and requires minimal boilerplate for tests.
This forces users to:
- manually create
WireMockServerbeans, - manage lifecycle themselves,
- or rely on ad-hoc workarounds (static ports, system properties, manual start/stop),
which is a regression compared to the 4.x testing experience.
Summary
@AutoConfigureWireMockwas not just convenience —
it was a crucial integration point for WebFlux- The official WireMock Spring Boot integration is not a drop-in replacement for reactive applications
- For Spring Cloud Gateway users, the removal significantly complicates integration testing
It would be very helpful to either:
- restore an equivalent reactive-safe test annotation, or
- clearly document a supported alternative specifically for WebFlux / Gateway.
Reacted by Dustin Allensworth, Samit Kumar Patel, Karol Mac, ina-lieder, radiment, Clemens and Игорь КудашевCan you provide a reproducer? From what I remember you could run WireMock with Boot in standalone version, then it wouldn't matter whether you're working with Webflux or not. If I'm mistaken then we could file an issue (and try to fix it) in WireMock's Spring Boot support
For the record, the official Wiremock integration for Spring Boot can be found nowadays here: https://github.com/wiremock/wiremock-spring-boot - I would recommend reporting an issue in that repository together with a sample project that reproduces it.
As far as I remember the initial implementation I made did not have anything Spring MVC or Webflux specific as it was just a convenient way to start Wiremock servers and propagate base urls to proper configuration properties in Spring context.
Reacted by Rodrigo Rodrigues@mhalbritter WDYT? ☝️
Sure, please open an issue on https://github.com/spring-io/start.spring.io/issues (there's a template for new entries) and we can take a look.

Describe the bug
Hello
I'm upgrading my app dependencies to move on:
And when I'm using the dependency
org.springframework.cloud:spring-cloud-contract-wiremock(imported with 5.0.0 as version), the annotationorg.springframework.cloud.contract.wiremock.AutoConfigureWireMockis missing.However, with version 4.3.1, the annotation is present.
For version 5+, is there an equivalent of
AutoConfigureWireMockto simply configure our tests?