contracts: consumer-driven contract testing lab (Spring Cloud Contract 5.0.3, Stubborn Contract 0.2.4, Pact JVM 4.7.7 on Spring Boot 4.2.0)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7h4ZNF4BDUpJk3Zou
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"consumer": {
|
||||
"name": "checkout-consumer"
|
||||
},
|
||||
"interactions": [
|
||||
{
|
||||
"description": "a request for order 42",
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "order 42 exists and is confirmed"
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/orders/42"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"id": 42,
|
||||
"status": "CONFIRMED",
|
||||
"total": 129.9
|
||||
},
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"matchingRules": {
|
||||
"body": {
|
||||
"$.id": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"$.status": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"$.total": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "decimal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": 200
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "a request for an unknown order",
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "order 999 does not exist"
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"path": "/orders/999"
|
||||
},
|
||||
"response": {
|
||||
"status": 404
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "a request to create an order",
|
||||
"providerStates": [
|
||||
{
|
||||
"name": "orders can be created"
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
"body": {
|
||||
"items": [
|
||||
{
|
||||
"qty": 2,
|
||||
"sku": "BOOK-1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"matchingRules": {
|
||||
"body": {
|
||||
"$.items[0].qty": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"$.items[0].sku": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "type"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"method": "POST",
|
||||
"path": "/orders"
|
||||
},
|
||||
"response": {
|
||||
"body": {
|
||||
"id": 1001,
|
||||
"status": "NEW",
|
||||
"total": 129.9
|
||||
},
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"matchingRules": {
|
||||
"body": {
|
||||
"$.id": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"$.status": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"$.total": {
|
||||
"combine": "AND",
|
||||
"matchers": [
|
||||
{
|
||||
"match": "decimal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": 201
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"pact-jvm": {
|
||||
"version": "4.7.7"
|
||||
},
|
||||
"pactSpecification": {
|
||||
"version": "3.0.0"
|
||||
}
|
||||
},
|
||||
"provider": {
|
||||
"name": "orders-producer"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user