Updated code and docs

This commit is contained in:
Marcin Grzejszczak
2017-04-26 12:42:33 +02:00
32 changed files with 641 additions and 447 deletions

View File

@@ -5,7 +5,7 @@ org.springframework.cloud.contract.spec.Contract.make {
method 'PUT' // (2)
url '/fraudcheck' // (3)
body([ // (4)
clientId: $(regex('[0-9]{10}')),
"client.id": $(regex('[0-9]{10}')),
loanAmount: 99999
])
headers { // (5)
@@ -16,7 +16,7 @@ org.springframework.cloud.contract.spec.Contract.make {
status 200 // (7)
body([ // (8)
fraudCheckStatus: "FRAUD",
rejectionReason: "Amount too high"
"rejection.reason": "Amount too high"
])
headers { // (9)
contentType('application/json')

View File

@@ -6,7 +6,7 @@ org.springframework.cloud.contract.spec.Contract.make {
url '/fraudcheck'
body("""
{
"clientId":"${value(consumer(regex('[0-9]{10}')), producer('1234567890'))}",
"client.id":"${value(consumer(regex('[0-9]{10}')), producer('1234567890'))}",
"loanAmount":123.123
}
"""
@@ -20,7 +20,7 @@ org.springframework.cloud.contract.spec.Contract.make {
status 200
body(
fraudCheckStatus: "OK",
rejectionReason: $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))
"rejection.reason": $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))
)
headers {
contentType("application/json")