Skip to main content
Spring Cloud Contract logo

Spring Cloud Contract Review

CategoryContract TestingFirst Released2016Official SiteApproachConsumer-driven contractsDeploymentSelf-hosted
Licensing Model
Open Source
  • Apache 2.0 license
  • Free to use forever
  • Consumer-driven contract testing
  • Part of Spring Cloud
  • Maintained by the Spring team
Free Trial
Free & Open Source
  • No licensing costs
  • No paid tier or subscription
  • Verifier and Stub Runner
  • HTTP and messaging contracts
Maintainer
Spring (Broadcom)
  • Part of Spring Cloud since 2016
  • Maintained by the Spring team
  • Owned by Broadcom, formerly VMware
  • The JVM contract testing standard
Ratings
  • GitHub Stars730
  • G2N/A
  • GartnerN/A

Overview

Spring Cloud Contract is a consumer-driven contract testing framework for Spring and JVM applications, and a sub-project of Spring Cloud. It implements contract testing for both HTTP and message-based interactions, with contracts defined in a DSL that the build then turns into provider verification tests and consumer stubs. It is licensed under Apache 2.0 and maintained by the Spring team at Broadcom, formerly VMware.

It is genuinely a contract testing tool, the JVM-world counterpart to Pact. Contracts are written in Groovy, YAML, Java, or Kotlin, usually on the provider side. The Spring Cloud Contract Verifier plugin for Maven or Gradle generates provider acceptance tests in JUnit or Spock at build time, plus WireMock stub mappings and messaging route stubs. Consumers then run those stubs through Stub Runner, so they test against behavior the provider has verified. The current GA line is 4.3.x, aligned with the 2025.0 Northfields release train and Spring Boot 3.5.

Spring Cloud Contract is for Spring Boot and JVM microservices teams that want contract testing native to their stack, using the same build, the same test frameworks, and WireMock stubs across HTTP and messaging. It can also fetch Pact files and run in Docker for polyglot consumers. Buyers should note that it is JVM and Spring-centric with polyglot support routed through Docker, that contracts are typically provider-authored rather than purely consumer-driven, and that it is tied to the Spring Cloud release train.

Key Featuresโ€‹

Contract DSLโ€‹

Contracts describing HTTP requests and responses or messages are written in Groovy, YAML, Java, or Kotlin. This fits different team preferences within the JVM world.

Verifier Pluginโ€‹

The Spring Cloud Contract Verifier plugin for Maven and Gradle generates provider acceptance tests in JUnit or Spock at build time. This verifies the provider honors the contract.

Stub Runnerโ€‹

Stub Runner downloads the generated stubs and spins up WireMock servers or messaging routes so consumers test against verified behavior. This closes the consumer-driven loop.

WireMock Stubsโ€‹

The Verifier produces WireMock JSON stub mappings for HTTP. This lets consumers run against realistic stubs.

Messaging Contractsโ€‹

Contracts cover messaging through Spring Integration, Spring Cloud Stream, and Apache Camel, with Kafka and RabbitMQ brokers. This extends contract testing to events.

Stub Runner Bootโ€‹

Stub Runner Boot is a standalone Spring Boot app that serves stubs. This decouples stub serving from the consumer build.

Polyglot via Dockerโ€‹

A Docker image generates and runs HTTP contract tests and produces WireMock stubs for non-JVM apps. This reaches Node.js, Python, and other consumers.

Pact Integrationโ€‹

It can fetch Pact files from a Pact Broker and generate tests and stubs, up to Pact v4. This interoperates with the Pact ecosystem.

Best Selling Pointsโ€‹

  • Contract testing native to the Spring and JVM stack.
  • The Verifier auto-generates provider tests in JUnit or Spock.
  • Stub Runner lets consumers test against verified stubs.
  • HTTP and messaging contracts in one framework.
  • A contract DSL in Groovy, YAML, Java, or Kotlin.
  • Free and open source, maintained by the Spring team.

Supported Integrationsโ€‹

Spring Cloud Contract integrates with JVM build tools, test frameworks, and messaging.

Connect Spring Cloud Contract across the JVM build and messaging stack.

  • Maven
  • Gradle
  • WireMock
  • Kafka
  • RabbitMQ
  • Pact Broker

Build & Test

  • Maven plugin
  • Gradle plugin
  • JUnit 4 and 5
  • Spock

Stubbing & Messaging

  • WireMock
  • Spring Cloud Stream
  • Spring Integration
  • Apache Camel
  • Kafka
  • RabbitMQ

Distribution

  • Nexus and Artifactory
  • Stub Runner Boot
  • Docker (polyglot)
  • Pact Broker

Spring Stack

  • Spring Boot
  • Spring Cloud
  • Spring Cloud Stream
  • Spring Integration

Adoptersโ€‹

Spring Cloud Contract is the standard contract-testing approach in the Spring and Java enterprise ecosystem.

  • Spring Boot teams
  • JVM microservices teams
  • Enterprise Java shops
  • Event-driven Spring systems
  • Spring Cloud adopters
  • CI/CD-driven teams
  • Polyglot teams via Docker
  • Open-source projects

Adoption & Usage Statisticsโ€‹

  • 730 GitHub stars on the repo
  • ~184 contributors
  • 4.3.x current GA line
  • 2025.0 Northfields release train
  • Spring Boot 3.5 alignment
  • Distributed via the Spring Cloud BOM

Note: the star count understates usage, since the project is distributed through the Spring Cloud release train rather than direct repo engagement, and metrics are from GitHub.

Supported Platformsโ€‹

Spring Cloud Contract runs on the JVM, with polyglot consumers supported through Docker.

Spring Cloud Contract runs on the JVM, with polyglot support via Docker.

  • Java
  • Kotlin
  • Groovy
  • Maven and Gradle
  • Docker
  • HTTP and messaging
  • Runtime: the JVM, with Spring Boot 3.5 on the current GA line.
  • DSL languages: Groovy, YAML, Java, and Kotlin.
  • Build tools: Maven and Gradle through the Verifier plugin.
  • Polyglot: Docker images for non-JVM consumers and providers.

Reportingโ€‹

Spring Cloud Contract produces standard JUnit or Spock results and stub artifacts.

Spring Cloud Contract produces standard test results and stub artifacts.

Result Outputs

Provider verification and stub artifacts through the build.

  • JUnit / SpockGenerated provider test results
  • WireMock StubsGenerated HTTP stub mappings
  • Stub ArtifactsPublished stubs jar to artifact repos
  • ContractsDSL contracts in the repository
  • Provider verification produces standard JUnit or Spock test results.
  • WireMock stub mappings are generated for HTTP.
  • Stub artifacts are published as a stubs jar to artifact repositories.
  • Contracts live in the repository in the chosen DSL.

Ecosystem & Extensionsโ€‹

Spring Cloud Contract is part of the Spring Cloud ecosystem with stub distribution and polyglot tooling.

  • The Verifier plugin generates provider tests and stubs at build time.
  • Stub Runner and Stub Runner Boot serve stubs to consumers.
  • The Docker images bring contract testing to non-JVM apps.
  • Pact integration ingests Pact files from a broker.

Releases and Maintenanceโ€‹

  • Current GA: Spring Cloud Contract 4.3.x, aligned with the 2025.0 Northfields release train and Spring Boot 3.5.
  • Upcoming: the 5.0.x line tracks the in-development 2025.1 train and Spring Boot 4.0.
  • Cadence: aligned with the Spring Cloud release trains.
  • Maintenance: actively maintained by the Spring team at Broadcom.

Pricingโ€‹

  • Spring Cloud Contract is free and open source under the Apache 2.0 license, with no paid tier or subscription.
  • It is consumed through Maven, Gradle, and the Spring Cloud BOM.
  • There is no commercial edition.

Awards & Recognitionโ€‹

  • Spring Cloud Contract is the standard JVM contract testing framework.
  • It is a core sub-project of Spring Cloud.
  • It is widely used across the Spring and Java enterprise ecosystem.
  • Recognition is adoption and ecosystem driven rather than through formal awards.

Limitationsโ€‹

  • It is JVM and Spring-centric, with polyglot support routed through Docker.
  • Contracts are typically provider-authored, so it is less purely consumer-driven than Pact.
  • The Groovy DSL has a learning curve, though YAML, Java, and Kotlin mitigate it.
  • It is tied to the Spring Cloud release train, adding upgrade coordination.
  • Setup is heavier than Pact for non-Spring teams.
  • Pact interoperability is capped at the Pact v4 representation.

Best Fit Scenariosโ€‹

  • Spring Boot and JVM microservices teams wanting native contract testing.
  • Teams using Maven or Gradle with JUnit or Spock already.
  • Event-driven Spring systems needing messaging contracts.
  • Organizations standardized on the Spring Cloud release train.
  • Teams that want generated provider tests and consumer stubs from one DSL.
  • Polyglot teams that can use the Docker image for non-JVM consumers.