Changed client / server to consumer / producer

This commit is contained in:
Marcin Grzejszczak
2016-07-21 11:36:11 +02:00
parent 4f2f04a820
commit 5ef7a7fee2
35 changed files with 336 additions and 283 deletions

View File

@@ -6,7 +6,7 @@ org.springframework.cloud.contract.spec.Contract.make {
url '/fraudcheck'
body("""
{
"clientId":"${value(client(regex('[0-9]{10}')), server('1234567890'))}",
"clientId":"${value(consumer(regex('[0-9]{10}')), producer('1234567890'))}",
"loanAmount":99999}
"""
)
@@ -18,11 +18,11 @@ org.springframework.cloud.contract.spec.Contract.make {
response {
status 200
body( """{
"fraudCheckStatus": "${value(client('FRAUD'), server(regex('[A-Z]{5}')))}",
"fraudCheckStatus": "${value(consumer('FRAUD'), producer(regex('[A-Z]{5}')))}",
"rejectionReason": "Amount too high"
}""")
headers {
header('Content-Type': value(server(regex('application/vnd.fraud.v1.json.*')), client('application/vnd.fraud.v1+json')))
header('Content-Type': value(producer(regex('application/vnd.fraud.v1.json.*')), consumer('application/vnd.fraud.v1+json')))
}
}

View File

@@ -6,7 +6,7 @@ org.springframework.cloud.contract.spec.Contract.make {
url '/fraudcheck'
body("""
{
"clientId":"${value(client(regex('[0-9]{10}')), server('1234567890'))}",
"clientId":"${value(consumer(regex('[0-9]{10}')), producer('1234567890'))}",
"loanAmount":123.123
}
"""
@@ -20,10 +20,10 @@ org.springframework.cloud.contract.spec.Contract.make {
status 200
body(
fraudCheckStatus: "OK",
rejectionReason: $(client(null), server(execute('assertThatRejectionReasonIsNull($it)')))
rejectionReason: $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))
)
headers {
header('Content-Type': value(test(regex('application/vnd.fraud.v1.json.*')), stub('application/vnd.fraud.v1+json')))
header('Content-Type': value(producer(regex('application/vnd.fraud.v1.json.*')), consumer('application/vnd.fraud.v1+json')))
}
}