Simplify samples used in documentation (#268)
This commit is contained in:
committed by
Marcin Grzejszczak
parent
3c8b712aa2
commit
7c8a8b4d33
@@ -9,7 +9,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
loanAmount: 99999
|
||||
])
|
||||
headers { // (5)
|
||||
contentType('application/vnd.fraud.v1+json')
|
||||
contentType('application/json')
|
||||
}
|
||||
}
|
||||
response { // (6)
|
||||
@@ -19,7 +19,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
rejectionReason: "Amount too high"
|
||||
])
|
||||
headers { // (9)
|
||||
contentType('application/vnd.fraud.v1+json')
|
||||
contentType('application/json')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,12 +42,12 @@ From the Consumer perspective, when shooting a request in the integration test:
|
||||
(4) - with the JSON body that
|
||||
* has a field `clientId` that matches a regular expression `[0-9]{10}`
|
||||
* has a field `loanAmount` that is equal to `99999`
|
||||
(5) - with header `Content-Type` equal to `application/vnd.fraud.v1+json`
|
||||
(5) - with header `Content-Type` equal to `application/json`
|
||||
(6) - then the response will be sent with
|
||||
(7) - status equal `200`
|
||||
(8) - and JSON body equal to
|
||||
{ "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
|
||||
(9) - with header `Content-Type` equal to `application/vnd.fraud.v1+json`
|
||||
(9) - with header `Content-Type` equal to `application/json`
|
||||
|
||||
From the Producer perspective, in the autogenerated producer-side test:
|
||||
|
||||
@@ -57,10 +57,10 @@ From the Producer perspective, in the autogenerated producer-side test:
|
||||
(4) - with the JSON body that
|
||||
* has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}`
|
||||
* has a field `loanAmount` that is equal to `99999`
|
||||
(5) - with header `Content-Type` equal to `application/vnd.fraud.v1+json`
|
||||
(5) - with header `Content-Type` equal to `application/json`
|
||||
(6) - then the test will assert if the response has been sent with
|
||||
(7) - status equal `200`
|
||||
(8) - and JSON body equal to
|
||||
{ "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
|
||||
(9) - with header `Content-Type` matching `application/vnd.fraud.v1+json.*`
|
||||
(9) - with header `Content-Type` matching `application/json.*`
|
||||
*/
|
||||
@@ -12,7 +12,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
"""
|
||||
)
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
rejectionReason: $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))
|
||||
)
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.springframework.cloud.contract.spec.Contract
|
||||
count: 200
|
||||
])
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -30,7 +30,7 @@ import org.springframework.cloud.contract.spec.Contract
|
||||
count: 100
|
||||
])
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
name: "fraud"
|
||||
])
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
}
|
||||
response {
|
||||
|
||||
@@ -8,7 +8,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
name: $(anyAlphaUnicode())
|
||||
])
|
||||
headers {
|
||||
contentType("application/vnd.fraud.v1+json")
|
||||
contentType("application/json")
|
||||
}
|
||||
}
|
||||
response {
|
||||
|
||||
Reference in New Issue
Block a user