Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

AutoConfigureWireMock missing in 5.0.0 #2397

Description

@Hansanto

Describe the bug
Hello

I'm upgrading my app dependencies to move on:

  • Spring Boot 4.0.1
  • Spring cloud dependencies 2025.1.0

And when I'm using the dependency org.springframework.cloud:spring-cloud-contract-wiremock (imported with 5.0.0 as version), the annotation org.springframework.cloud.contract.wiremock.AutoConfigureWireMock is missing.

However, with version 4.3.1, the annotation is present.

For version 5+, is there an equivalent of AutoConfigureWireMock to simply configure our tests?

Activity

  1. Hansanto commented on Jan 5, 2026

    @Hansanto
    Author

    For people searching: #2289

  2. marcingrzejszczak commented on Jan 5, 2026

    @marcingrzejszczak
    Contributor

    Yes, we removed the support in favour of the official WireMock's Spring Boot integration

  3. KnightKenobi commented on Jan 5, 2026

    @KnightKenobi

    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, @AutoConfigureWireMock was 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 @AutoConfigureWireMock effectively 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 WireMockServer beans,
    • 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

    • @AutoConfigureWireMock was 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.
  4. marcingrzejszczak commented on Jan 6, 2026

    @marcingrzejszczak
    Contributor

    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

    cc @maciejwalkowiak

  5. maciejwalkowiak commented on Jan 6, 2026

    @maciejwalkowiak

    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.

  6. rodrigorodrigues commented on Feb 13, 2026

    @rodrigorodrigues

    It would help if they add this new Wiremock-spring-boot on Spring Initializr, right now is showing only contract stub

    Image
  7. marcingrzejszczak commented on Feb 14, 2026

    @marcingrzejszczak
    Contributor

    @mhalbritter WDYT? ☝️

  8. mhalbritter commented on Feb 16, 2026

    @mhalbritter

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions