Spring Cloud Contract


Table of Contents

1. Spring Cloud Contract
2. Spring Cloud Contract Verifier
2.1. Introduction
2.1.1. Why?
Testing issues
2.1.2. Purposes
2.1.3. How
Define the contract
Client Side
Server Side
2.1.4. Step by step guide to CDC
Technical note
Consumer side (Loan Issuance)
Producer side (Fraud Detection server)
Consumer side (Loan Issuance) final step
2.1.5. Dependencies
2.1.6. Additional links
Spring Cloud Contract video
Readings
2.1.7. Samples
2.2. FAQ
2.2.1. Why use Spring Cloud Contract Verifier and not X ?
2.2.2. What is this value(consumer(), producer()) ?
2.2.3. How to do Stubs versioning?
API Versioning
JAR versioning
Dev or prod stubs
2.2.4. Common repo with contracts
Repo structure
Workflow
2.2.5. Can I have multiple base classes for tests?
2.2.6. How can I debug the request/response being sent by the generated tests client?
2.2.7. How can I debug the mapping/request/response being sent by WireMock?
2.2.8. How can I see what got registered in the HTTP server stub?
2.2.9. Can I reference the request from the response?
2.2.10. Can I reference text from file?
2.3. Spring Cloud Contract Verifier HTTP
2.3.1. Gradle Project
Prerequisites
Run plugin
Default setup
Configure plugin
Invoking generated tests
Spring Cloud Contract Verifier on consumer side
2.3.2. Using in your Maven project
Add maven plugin
Add stubs
Run plugin
Configure plugin
Invoking generated tests
FAQ with Maven Plugin
Spring Cloud Contract Verifier on consumer side
2.3.3. Scenarios
2.3.4. Stubs and transitive dependencies
2.4. Spring Cloud Contract Verifier Messaging
2.4.1. Integrations
2.4.2. Manual Integration Testing
2.4.3. Publisher side test generation
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (no output message)
2.4.4. Consumer Stub Side generation
2.5. Spring Cloud Contract Stub Runner
2.5.1. Snapshot versions
2.5.2. Publishing stubs as JARs
2.6. Stub Runner Core
2.6.1. Retrieving stubs
Stub downloading
Classpath scanning
2.6.2. Running stubs
Limitations
Running using main app
HTTP Stubs
Viewing registered mappings
Messaging Stubs
2.7. Stub Runner JUnit Rule
2.7.1. Maven settings
2.7.2. Providing fixed ports
2.7.3. Fluent API
2.7.4. Stub Runner with Spring
2.8. Stub Runner Spring Cloud
2.8.1. Stubbing Service Discovery
Test profiles and service discovery
2.8.2. Additional Configuration
2.9. Stub Runner Boot Application
2.9.1. How to use it?
Stub Runner Server
Spring Cloud CLI
2.9.2. Endpoints
HTTP
Messaging
2.9.3. Example
2.9.4. Stub Runner Boot with Service Discovery
2.10. Stubs Per Consumer
2.11. Common
2.11.1. Common properties for JUnit and Spring
Stub runner stubs ids
2.12. Stub Runner for Messaging
2.12.1. Stub triggering
Trigger by label
Trigger all messages
2.13. Stub Runner Camel
2.13.1. Adding it to the project
2.13.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.14. Stub Runner Integration
2.14.1. Adding it to the project
2.14.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.15. Stub Runner Stream
2.15.1. Adding it to the project
2.15.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.16. Stub Runner Spring AMQP
2.16.1. Adding it to the project
2.16.2. Examples
Stubs structure
Triggering the message
Spring AMQP Test Configuration
2.17. Contract DSL
2.17.1. Limitations
2.17.2. Common Top-Level elements
Description
Name
Ignoring contracts
Passing values from files
2.17.3. HTTP Top-Level Elements
2.17.4. Request
2.17.5. Response
2.17.6. Dynamic properties
Dynamic properties inside the body
Referencing request from response
Dynamic properties in matchers sections
2.17.7. JAX-RS support
2.17.8. Async support
2.17.9. Working with Context Paths
2.17.10. Messaging Top-Level Elements
Output triggered by a method
Output triggered by a message
Consumer / Producer
2.17.11. Multiple contracts in one file
2.18. Customization
2.18.1. Extending the DSL
Common JAR
Adding the dependency to project
2.19. Pluggable architecture
2.19.1. Custom contract converter
Pact converter
2.19.2. Custom test generator
2.19.3. Custom stub generator
2.19.4. Custom Stub Runner
2.19.5. Custom Stub Downloader
2.20. Links
3. Spring Cloud Contract WireMock
3.1. Registering Stubs Automatically
3.2. Using Files to Specify the Stub Bodies
3.3. Alternative: Using JUnit Rules
4. Relaxed SSL Validation for Rest Template
5. WireMock and Spring MVC Mocks
6. Generating Stubs using RestDocs
7. Generating Contracts using RestDocs
8. Migrations
8.1. 1.0.x → 1.1.x
8.1.1. New structure of generated stubs
8.2. 1.1.x → 1.2.x
8.2.1. Custom HttpServerStub
8.2.2. New packages for generated tests