LibraryActive

Spring Cloud Contract

Spring Cloud Contract is a Spring project for Consumer-Driven Contracts and service stubbing.

Open source page

Field note

What it does

Spring Cloud Contract is a Spring project for Consumer-Driven Contracts and service stubbing.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

sdk

groovy / org.springframework.cloud:spring-cloud-contract

sdk

java / https://docs.spring.io/spring-cloud-contract/reference/

other

Not filed / Not filed

other

Not filed / Not filed

other

Not filed / Not filed

other

Not filed / Not filed

sdk

java / https://docs.spring.io/spring-cloud-contract/reference/

cli

java / Not filed

Product features

Product features

ATDD Support

Promote the acceptance test-driven development method and the microservices architectural style.

@AutoConfigureStubRunner

Annotate test classes with @AutoConfigureStubRunner providing group-id and artifact-id.

Base Class for Tests

Specify a base test class via baseClassForTests for auto-generated tests.

Boilerplate Test Generation

Generate boilerplate test code to be used on the server side.

Contract Publishing

Provide a way to publish changes in contracts that are immediately visible on both sides.

Contract Verifier Plugin

Plugin to run integration tests and generate stubs from contracts.

Contracts DSL Directory

Add REST or messaging contracts in Groovy DSL or YAML; default path is $rootDir/src/test/resources/contracts.

Contracts on the Producer Side

Step-by-step guide to consumer-driven contracts with contracts defined on the producer side.

Generated Verification Tests

Running the build automatically generates tests verifying application compliance with contracts.

Gradle Plugin

Gradle contracts DSL with contractRepository and publishStubsToScm.

Groovy DSL Contracts

Define contracts using a statically typed Groovy DSL with dynamic value matching.

HTTP Stubs

Ensure HTTP stubs used when developing the client do exactly what the actual server-side implementation does.

Maven Plugin

spring-cloud-contract-maven-plugin with contractsRepositoryUrl and contractsMode configuration.

Messaging Contracts

Define input and output messages for messaging-based contracts.

Messaging Stubs

Ensure messaging stubs used when developing the client do exactly what the actual server-side implementation does.

Provider Contract Testing with Stubs in Git

Run provider contract testing using stubs stored in Git.

Provider Contract Testing with Stubs in Nexus or Artifactory

Run provider contract testing using stubs published to Nexus or Artifactory.

pushStubsToScm

Maven goal and Gradle task to push stubs to SCM at the end of the build.

Spring Framework Documentation

Stub generation

Generate stubs for use in provider contract testing.

Stub Runner

Consumer-side component that downloads and runs stubs using the git protocol.

Stub Runner with WireMock

Use Spring Cloud Contract Stub Runner to run a WireMock instance or messaging route in integration tests.

Stub Storage

Stubs can be stored in Nexus or Artifactory.

Stubs in Git

Store and fetch stubs from a Git repository instead of Nexus or Artifactory.

Stubs in Nexus or Artifactory

Provider contract testing with stubs published to Nexus or Artifactory.

Stubs Mode

Use REMOTE stubsMode to download stubs or LOCAL for offline work.

TDD at architecture level

Moves TDD to the level of software architecture.

Test Framework Support

Supports MockMvc, JAX-RS, and WebTestClient test modes.

YAML Contracts

Define contracts in YAML format.